Help me start a rogram - Complex nembers

I have an assignment that includes complex numbers, and I have no idea what a complex number is and where to start. Is there anyone that could help me get started?
Program details:
Given a complex number a+ib, we can define the following operations:
* |a+ib| = square root of (a2+b2) is the absolute value operation.
* s(a+ib)=sa+isb, where s is a real number, is scaling.
* the complex conjugate of a+ib is a-ib.
* (a+ib)+(c+id)=(a+c)+i(b+d) is addition.
* (a+ib)*(c+id)=(ac-bd)+i(ad+cb) is multiplication. (Notice that scaling is just a special case, where b=0.)
* do subtraction on your own.
* (a+ib)/(c+id)=((ac+bd)+i(cb-ad))/(c2+d2) is division. You will have to be careful when dividing - the resulting denominator cannot be equal to 0!
You are to write a program which contains two separate files.
The first file will define a Complex class which should include exactly two data members, two constructors, the operations defined above, and a toString method. Important note, the scaling, conjugate, addition, multiplication, subtraction, and division operations all return another complex number. You also must include the appropriate set and get methods. Be sure you comment this class appropriately. Each function should have its own set of comments.
The second file is an application to test your Complex class as follows: repeatedly read numbers of type double (a, b, c, d, and s), create and print the complex numbers a+ib and c+id, print each numbers absolute value, then create and print the following new complex numbers: s(a+ib), the complex conjugate of a+ib, and the sum, product, difference, and quotient of a+ib and c+id. Continue this loop until the user terminates the application.

Yes, learn complex numbers. Java is the least of your problems.
%

Similar Messages

  • Need help to start with some file and text manipulation

    Hello script mavens,
    I need help with starting a script that does the following:
    -within a base folder it takes an inventory (list?) of all the files (which happen to be image files).
    -creates a new folder inside the base folder and calls it imagesX where X increases by one every time the script is run
    -moves all the files into the images folder
    -within the base folder it creates a new text file and calls it imagesX.js
    -writes a "//-" into imagesX.js
    -then writes the list of filenames into the imagesX.js twice, separated by an empty line, and adds a semicolon to the end of each filename and saves imagesX.js
    -from a folder a level above the base folder it copies a file called index.html into the base folder and renames in indexX.html
    -in indexX.html it replaces a string "replaceThis" with "imagesX.js"
    The task is more complex but this would help me tremendously do the rest.
    If I am asking for too much on this forum please let me know

    This should get you started.
    The description of how you want to write the data isn't clear, but the rest should work (untested):
    property imageNum : 0 -- last used ImageNumber
    -- within a base folder it takes an inventory (list?) of all the files (which happen to be image files).
    -- get the folder:
    set baseFolder to (choose folder)
    -- now get the files within it:
    tell application "Finder"
    set fileList to every file of folder baseFolder as alias list
    end tell
    --creates a new folder inside the base folder and calls it imagesX where X increases by one every time the script is run
    tell application "Finder"
    set imageNum to imageNum + 1
    set newImageFolder to make new folder at baseFolder with properties {name:"images" & imageNum}
    -- moves all the files into the images folder
    move every file of folder baseFolder to newImageFolder
    --within the base folder it creates a new text file and calls it imagesX.js
    set textFile to (open for access file (baseFolder as text) & "images" & imageNum & ".js" with write permission)
    --writes a "//-" into imagesX.js
    write "//-" to textFile
    -- then writes the list of filenames into the imagesX.js twice, separated by an empty line, and adds a semicolon to the end of each filename and saves imagesX.js
    -- need more info here
    -- a blank line between each instance of the file name? or all file names, blank line, all file names again?
    -- an example, please
    close access textFile
    --from a folder a level above the base folder it copies a file called index.html into the base folder
    --and renames in indexX.html
    --in indexX.html it replaces a string "replaceThis" with "imagesX.js"
    -- the easiest way of doing this is to read the file and write a new copy with the changes - that's easier than changing it in situ:
    set indexHTML to (read file "index.html" of folder (container of baseFolder))
    set {oldTIDs, my text item delimiters} to {my text item delimiters, "replaceThis"}
    set indexHTML to text items of indexHTML
    set my text item delimiters to "imagesX.js"
    set indexHTML to indexHTML as text
    set my text item delimiters to oldTIDs
    set indexFile to (open for access file ("index" & imageNum & ".html") with write permission)
    write indexHTML to indexFile
    close access indexFile
    end tell

  • Please help i started my project video format 720HD resolution 12x720 rate 25p at last when i finish and burn to dvd the edges are cut off any one help please i am really in trouble

    please help i started my project with  video format 720HD, resolution 12x720, rate 25p.  at last when i finish and burn to dvd the edges are cut off and my logo cut off the screeen aswell any one help please i am really in trouble. thanks

    Sorry, but I don't know anything about that app.
    I did go to their Web site and I see they have a support link. Perhaps you can get help there or in their forum.
    If you are OK with a DVD with a basic menu, you could try the Share>DVD option in FCP.
    Good luck.
    Russ

  • Pls help in starting a project

    Hello,
    I request for help in starting a sample project bc4j under JDeveloper. The folder resides in Programfiles\Oracle\Jdeveloper3.2\samples.
    I have been asked to go to ..\samples\bc4j directory and create user bc4j identified by bc4j, grant resource, connect to bc4j and then to start project @..\samples\bc4j\onlineorders.sql
    I am new to Oracle as well as JDeveloper. This is a request to let me know which commands to carry out for creating user, granting resource, connecting to bc4j and finally to start sample project.
    Thanks a lot in advance
    Sana

    If you're new to Oracle, you might want to read "SQL for Web Nerds" http://www.arsdigita.com/books/sql
    I've just started using Forte Community Edition, the free version of the Java IDE from Sun. Help / Contents will bring up detailed help topics, such as how to start a project. I'm not familiar with JDeveloper, so all I can recommend is to try the help menu.

  • FPGA for CAN, DI, AI help getting started

    I am a new user to LabView.
    I am trying to program the FPGA on a 9144 Ethercat chassis with modules 9423 (Digital input), 9201 (Analog input), 9853 (CAN).  9144 is connected to a cRIO-9024.  There are more modules but if I can figure these out, the others should be almost the same.
    I have tried to copy the code in the following examples but not all the referenced VI's are on my computer or there is problems with the code that I don't know how to fix
    http://zone.ni.com/devzone/cda/tut/p/id/6628
    http://zone.ni.com/devzone/cda/epd/p/id/5473
    I am able to monitor the digital input and analog input using the real-time VI's, but that is pretty simple.
    Normally, I would just pound away at it for a while until I got something that worked, except there are some deadlines that have to be met.
    I need to be able to read and write CAN (this is to control a motor).  The digital input needs to measure the frequency (Hz) of the incoming signal (count edges). Analog input I would assume would be the easiest as it is just reading a voltage.  I realize that the only thing that really needs to run on the FPGA is the CAN.  I believe (and hoping) that it is possible to have all the data input come through the FPGA so that the Real-Time VI's only deal with the usable values like Hz and then equate that to RPM for example.  I am only looking to extract data at a rate of 1Hz.
    If anyone could help me out with some basic code to get me started, I would appreciate it.

    This FPGA VI has controls and indicators in it. It can only
    run on the FPGA targets that support Interactive Front Panel Communication
    (e.g. cRIO-9024) so that the host computer displays the FPGA VI front panel
    window and the FPGA target executes the FPGA VI block diagram. Please refer to
    LabVIEW Help (FPGA Module) for more information about the Interactive Front
    Panel Communication.
    However, support of Interactive Front Panel Communications
    varies by FPGA target – NI 9144 is one of the targets that doesn’t support it. With
    NI 9144, please use User-defined Variables to communicate between the host and
    the NI 9144 FPGA target, and then your FPGA VI automatically runs when you
    compile and download the FPGA VI to NI 9144 instead of clicking the Run button.
    Here is a document about the data transferring between the FPGA and the host. Section User-Defined I/O Variables for Custom FPGA I/O Data describes how to use User-defined Variables.
    Transferring Data between the FPGA and the Host (FPGA Module)
    Here is more information for your reference:
    1. Examples about programming FPGA on NI 9144:
    <NI Example Finder> >> Hardware Input and Output >> NI-Industrial Communications >> EtherCAT >> FPGA Fundamentals
    2. Help Topics:
    <Start
    Menu> >> All Programs >> National Instruments >> NI-Industrial Communications
    for EtherCAT >> NI-IndCom for
    EtherCAT Help >> Programming
    the FPGA on NI 9144 Slave Device
    Feilian (Vince) Shen

  • Help- Flex Start Page doesn't open the Start Page

    Help -> Flex Start Page doesn't open the Start Page.
    I see multiple bug entries regarding this resolved, but no description of what I can do to fix it.
    I'm running Flex Builder Professional on Windows XP

    I've heard this can be caused in IE when the pop-up blocker is enabled. Disable it so pop-ups are allowed, and the Flex Start Page may load.
    If this post answers your question or helps, please mark it as such.

  • I want to get rid of everything in itunes , music, movies etc and start afresh. Ive deleted all old libraries but still there is stuff in iTunes. Please help me start afresh?

    i want to get rid of everything in itunes , music, movies etc and start afresh. Ive deleted all old libraries but still there is stuff in iTunes. Please help me start afresh?

    Please do not delete any files from the HDD without having a current backup.
    I'm not sure what you mean when you say you've "deleted all old libraries." Can you explain that?
    If all you are wanting to do is empty the iTunes library of all music, video playlists, etc. the easiest way is to quit iTunes and, in the Finder, go to ~/Music/iTunes and simply move the .itdb, .itl and .xml files to the trash. Launch iTunes again and the library will be empty.
    You should be prompted to add content, so you can let iTunes scan the HDD if you like.

  • I haven't used an Apple computer for years. I need help getting started

    I just bought a mac mini after 20 years using a PC.  I need help getting started.  Any beginning manuals out there?  Thanks.

    New User of Apple wrote:
    I just bought a mac mini after 20 years using a PC.  I need help getting started.  Any beginning manuals out there?  Thanks.
    Welcome back. Do not overlook the Finder and individual application Help menu support. The links provided above are great starter references. With tongue in cheek, they also may not be as current as the OS X release on your mini, so expect some differences.
    Here are a litany of keyboard short-cuts, last updated in June 2012, that may prove selectively beneficial.
    For actions like copy(c), paste(v), cut(x), print(p), and select-all(a), substitute the command key instead of control key.
    If you right click on a file, this menu will seem familiar. Press the option key and notice the menu changes. If you copy a file(s) from this menu, change to the destination and then press option with the right button menu to see copy file(s) changed to move file(s).
    To quickly view a file's contents, left click on the file icon, then press the space bar.
    The native file format for OS X is PDF. Thus, when you choose to print, you also have the option to save as PDF with web links preserved.
    Enjoy your mini.

  • TS1702 I just updated numbers to newest version and found that numbers quits to home screen when I tap the information icon on "function  help", it starts to load the "help" then quits  this happens on both my ipad3 & iphone5

    2/3/14: I just updated numbers to newest version and found that numbers quits to home screen when I tap the information icon on "function  help", it starts to load the "help" then quits. It happens on both my ipad3 &amp; iphone5. I tried restarting the devices but it didn't help.

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430
    iOS 7: Help with how to fix a crashing app on iPhone, iPad (Mini), and iPod Touch
    http://teachmeios.com/help-with-how-to-fix-a-crashing-app-on-iphone-ipad-mini-an d-ipod-touch/
    Troubleshooting apps purchased from the App Store
    http://support.apple.com/kb/TS1702
    Delete the app and redownload.
    Downloading Past Purchases from the iTunes Store, App Store and iBooks Store
    http://support.apple.com/kb/ht2519
     Cheers, Tom 

  • Q : i have downloaded trial version of creative cloud ... kindly help to start trial on it ... it is not opening only

    Q : i have downloaded trial version of creative cloud ... kindly help to start trial on it ... it is not opening only ?

    What do you mean?
    Cloud desktop problems
    Sign Out When Sign In http://forums.adobe.com/thread/1450581?tstart=0 may help
    -and http://helpx.adobe.com/creative-cloud/kb/unable-login-creative-cloud-248.html
    -and 'looping' https://forums.adobe.com/thread/1504792
    BLANK Cloud Screen http://forums.adobe.com/message/5484303 may help
    -and step by step http://forums.adobe.com/thread/1440508?tstart=0
    -and http://helpx.adobe.com/creative-cloud/kb/blank-white-screen-ccp.html
    Mac Spinning Wheel https://forums.adobe.com/message/5470608
    -Similar in Windows https://forums.adobe.com/message/5853430

  • What happened to the 24/7 live chat for mobile me? I need help right now. Too complex for this. Crime involved., What happened to the 24/7 live chat for mobile me? I need help right now. Too complex for this. Crime involved.

    What happened to the 24/7 live chat for mobile me? I need help right now. Too complex for this. Crime involved., What happened to the 24/7 live chat for mobile me? I need help right now. Too complex for this. Crime involved.

    Hi Tmswrite,
    Here is what you want to do to protect yourself and your device:
    Find My iPhone Basics  - Apple Support
    iCloud: Find My iPhone overview
    Here's some information on how the Activation Lock protects you:
    Find My iPhone Activation Lock in iOS 7
    Sorry for your troubles. Hope it turns out OK for you!
    GB

  • Can someone help me start up my photoshop?

    Can someone help me start up my photoshop???
    It worked fine the other day, but my shortcut dissappeared and there is no obvious way to launch it otherwise.

    Did you mean Photoshop Elements? For PSE, you can find the exe at C:\Program Files (x86)\Adobe\Elements 11 Organizer\Photoshop Elements 11.0.exe You can write click the file and choose "send to :> desktop" to get your shortcut back
    If you actually meant Photoshop, you should be able to find the program launcher at "C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Photoshop.exe"
    In case you are on Mac, go to Applications/Support Files and there you would find your app

  • HELP - MacBook Pro won't start up - get complex error!

    Dear All would be VERY grateful if someone could help me - please note that this is NOT a standard error. I have read the manual on start-up problems and they have not resolved the issue.
    The problem is that my MacBook fails to launch OSX, though it did produce the start-up sound and the spinning gear symbol. After this, it displays a terminal with the following error:
    localhost kextd[25]: couldn't start up diskarb sessions
    it does this about 7 times then:
    localhost kextd[25]: giving up on diskarb: auto-rebuild disabled.
    I tried to use the Installation Disk to get to Disk Utilities to fix the problem but nothing happened and I couldn't even eject the CD!
    Any advice would be much appreciated, especially if you have encountered a similar error. Thanks in advance for your help.

    Try this
    Boot holding down Apple/S and don't let go until you see scrolling text.
    When that stops and you see a root#: prompt enter
    fsck -fy
    Let it run through all the checks and repairs.
    If it fails first time, at any time, or finds and fixes a fault - run the command again and keep doing so (some fixes can take several passes) until it says "Appears to be OK" then enter
    reboot

  • Urgent: PLS help me start the CEP server after upgrade to 11.1.1.7

    Dear Legends,
    I referred the following doc to upgrade OCEP to 11.1.1.7 http://docs.oracle.com/cd/E28280_01/doc.1111/e14476/install.htm#CHDHHJIA
    I executed the steps in 2.8.2 and tried to start the server. But it is not starting up ,instead giving the following error:
    Cannot get bundle from registry class com.bea.cie.lconfig.NonDeterministicFeatureException: Oracle Complex Event Processing:11.1.6.0/org.eclipse.persistence_2.2.0.v20110202-r8913, Oracle Event Processing:11.1.7.0/org.eclipse.persistence_2.2.0.v20110202-r8913
    class com.bea.cie.lconfig.NonDeterministicFeatureException: Oracle Complex Event Processing:11.1.6.0/org.eclipse.persistence_2.2.0.v20110202-r8913, Oracle Event Processing:11.1.7.0/org.eclipse.persistence_2.2.0.v20110202-r8913
    at com.bea.cie.lconfig.internal.RegistryConfiguration.getInputFeatureList(RegistryConfiguration.java:172)
    at com.bea.cie.lconfig.internal.RegistryConfiguration.addFeatures(RegistryConfiguration.java:71)
    at com.bea.cie.lconfig.internal.RegistryConfiguration.<init>(RegistryConfiguration.java:37)
    at com.bea.cie.lconfig.internal.DefaultConfigurationFactory.createConfiguration(DefaultConfigurationFactory.java:17)
    at com.bea.wlevs.Launcher.getBundleFromFeature(Launcher.java:749)
    at com.bea.wlevs.Launcher.loadBundles(Launcher.java:840)
    at com.bea.wlevs.Launcher.run(Launcher.java:266)
    at com.bea.wlevs.Launcher.main(Launcher.java:133)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.wlevs.Server.main(Server.java:238)
    Dear Legends,
    I referred the following doc to upgrade OCEP to 11.1.1.7 http://docs.oracle.com/cd/E28280_01/doc.1111/e14476/install.htm#CHDHHJIA
    I executed the steps in 2.8.2 and tried to start the server. But it is not starting up ,instead giving the following error:
    Cannot get bundle from registry class com.bea.cie.lconfig.NonDeterministicFeatureException: Oracle Complex Event Processing:11.1.6.0/org.eclipse.persistence_2.2.0.v20110202-r8913, Oracle Event Processing:11.1.7.0/org.eclipse.persistence_2.2.0.v20110202-r8913
    class com.bea.cie.lconfig.NonDeterministicFeatureException: Oracle Complex Event Processing:11.1.6.0/org.eclipse.persistence_2.2.0.v20110202-r8913, Oracle Event Processing:11.1.7.0/org.eclipse.persistence_2.2.0.v20110202-r8913
    at com.bea.cie.lconfig.internal.RegistryConfiguration.getInputFeatureList(RegistryConfiguration.java:172)
    at com.bea.cie.lconfig.internal.RegistryConfiguration.addFeatures(RegistryConfiguration.java:71)
    at com.bea.cie.lconfig.internal.RegistryConfiguration.<init>(RegistryConfiguration.java:37)
    at com.bea.cie.lconfig.internal.DefaultConfigurationFactory.createConfiguration(DefaultConfigurationFactory.java:17)
    at com.bea.wlevs.Launcher.getBundleFromFeature(Launcher.java:749)
    at com.bea.wlevs.Launcher.loadBundles(Launcher.java:840)
    at com.bea.wlevs.Launcher.run(Launcher.java:266)
    at com.bea.wlevs.Launcher.main(Launcher.java:133)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.wlevs.Server.main(Server.java:238)
    please help me resolve this issue.
    Thanks in Advance.
    Thanks in Advance.

    Hi,
    I used OCEP 10.3.0.0 and upgraded the wlevs30 domain to PS6(11.1.1.7.0). and it worked without such error.
    My experience is:
    1) in OCEP 10.3.0.0 it needs not to add the security groups in atnstore.txt
    2) you need to add <scratch-directory/> for Jetty in server's config.xml otherwise you will see the visualizer takes a long time to get up on Windows
    Thanks
    Junger

  • Help with starting point for "proof of concept" integration

    We are a third party application provider and are attempting to figure out how to do a "proof of concept" integration with SAP.  We are not looking for "certification".  Our product does not appear to fit any of the standard certifications for integration and our experience integrating with other systems indicates that no two integration will be identical.
    We are looking to do a simple integration scenario with an SAP system so we have some basic experience doing it, can say 'Yes" when asked if we have done it, and can create a video showing a transaction being done in SAP and our system also updating (and ideally the reverse).
    Our starting point with respect to SAP knowledge is "0".
    Our basic task list (we think) goes something like
    1.  Figure out the version and modules of SAP with which we should be integrating
    2.  Get access to an SAP system (do we rent, is there a developer/evaluation, ...)
    3.  Put some data in the test system (is there a "sample data" set?)
    4.  Figure out the SAP transactions that map to the business process in which we are interested (moving goods in and out of a distribution center/ware house - are there some "standard business process guides")
    5.  Integrate (we are a .NET web based application so we are guessing this means use the ".Net Connector")
    Could anyone point out any resources (white papers, links, people, places to find people,...) that might be a good starting point?
    Thanks,
    John

    Athol,
    We are looking to recieve notifications out of SAP as tractor trailers at a dock are filled as proof on concept.  The actual integration scenarios we do are more complex and do not match well with any of the pre-packaged certification scenarios.  The real world integration scenarios actual vary substantially from customer to customer in terms of the integration points between systems.
    As we have become more marginally knowledgable about SAP, I think we will end up receiving and sending "IDOC" messages from SAP but have no idea what those IDOC messages are or where to start looking for what a "standard" (if there is one) message SAP would generate in reaction to whatever the "trailer is loaded" transaction is.
    To figure out what the transaction is, I assume we need to identify what version of SAP we should be targeting for a simple integration.  Are there any could references on what the commonly integration methods are and to which versions they apply?
    Something like "hey, if you do an integration with a IDOCs in with SAP Netweaver 2004 then that would good proof you could integrate with 90% of the installed SAP base".  Of course, any links explaining what the versions of SAP are and where they are in there lifecycle and what people are actually using would be helpful.
    John

Maybe you are looking for