Solved

Complex and Imaginary Numbers

Posted on 2006-07-10
4
641 Views
Last Modified: 2008-02-01
I need to Write a class to store complex numbers and provide operations for the four basic arithmetic operations along with input and output operations. (You must have a class that has attributes of a real and an imaginary part. You would have 2 instances of this class for 2 complex numbers.) Use the time type project in your text to see help you with two class objects interacting.
Write a program to read two complex numbers and a symbol for one of these operations and to perform the indicated operations.  
Allow your program to continue until the user decides to Quit.

I need to write this for a case study, but i dón't really understand complex numbers.

Thanks in advance


Here are the formulas. Any help would be greatly appreciated, guidance is what i'm looking for.

A complex number has the form a + bi, where a and b are real numbers and
i² = -1.  The four basic arithmetic operations for complex numbers are defined as follows:

      addition:            (a + bi)+(c + di) = (a + c)+(b + d)i

      subtraction:            (a + bi)-(c + di) = (a - c)+(b - d)i

      multiplication:            (a + bi)*(c + di) = (ac – bd)+(ad + bc)i

      division:            a + bi = (ac + bd) + (bc – ad)  i
                        c + di   (c² + d²)    (c² + d²)

                        provided   both c and d do not equal zero

0
Comment
Question by:basile
  • 2
  • 2
4 Comments
 
LVL 35

Expert Comment

by:mrichmon
ID: 17073579
This sounds like an assignment for a course.  We cannot give you this type of answer, but we can help you if you get stuck.  Why don't you post what you have tried and then ask specific questions.

To do the above you don't really need to understand complex numbers.  Just look at the formulas that were provided and think about how you would implement that in code.
0
 
LVL 1

Author Comment

by:basile
ID: 17074115
Yes, it is an assignment. I can write this easily in VB.net, i just cant figure it out forthe C# implementation.

Can i show what i have in vb ?
0
 
LVL 35

Accepted Solution

by:
mrichmon earned 500 total points
ID: 17074311
Sure.  But also you need to show what you have so far in C# and what is not working.  We can't do an assignement for you, but can help guide you if you have specific questions.  For example, "Why does ____ not compile" or stuff like that.
0
 
LVL 1

Author Comment

by:basile
ID: 17075871
Ok. I will get that and post it in here...
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
InputLanguage 1 33
Please explain the parts of these 2 LINQ expressions 3 53
How come this regular expression allows "e"? 14 45
insert value of checklistbox checked 4 32
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question