![]() |
|
#1
|
|||
|
|||
US dollar amount, the result is all zeros.This is what I basically need. Can someone please help me? I'm lost.
Write a C program that displays a title, "Currency Conversion," and then display the names of five currencies and their equivalents to $100 US dollars. The program must use named constants (for any value that remains constant), variables and equations. The program should calculate the equivalency of $100 US dollars to the Euro, Japanese Yen, UK Pound, Germany Deutsche Marc, French Franc. For purposes of this exercise, use the following conversion factors: 1 US dollar = 0.926698 Euro 1 US dollar = 6.07874 Franc 1 US dollar = 120.300 Yen 1 US dollar = 1.81246 Deutsche Marc 1 US dollar = 0.619579 Pound Once you have calculated the equivalency of $100 US dollars for each currency (using equations with variables and named constants), display the results on the screen. Be sure to label each result with the correct currency name. Before you display the 5 results, you should display "$100 US dollars is equivalent to:". I also need the source code for this program. Thanks in advance to anyone that can help me. This is what I have so far. CPP / C++ / C Code:
Last edited by admin : 08-Sep-2005 at 20:49.
Reason: Please insert your C code between [c] & [/c] tags
|
|
#2
|
||||
|
||||
|
Where are you lost ?
What is the problem ? I can see that the application is almost finished. What errors are you getting ? Kobi Hikri. |
|
#3
|
||||
|
||||
|
Quote:
1. Well, for starters, Your function ConvertCurrency is good, and I didn't change it. 2. I did some indentation and removed your CPP / C++ / C Code:
3. Why do you ask for student name but dont read it (e.g with scanf) ? 4. You had some errors in places where you wrote your constant names (syntax errors), This is something you shoud get used to check. Basically a good work :-P This is the code (your code) I fixed. Try to continue on your own. Post any problem. CPP / C++ / C Code:
Best regards, Kobi Hikri. |
|
#4
|
|||
|
|||
Miracle C HelpThanks so much for your help!.. I really appreciate it! What is wrong is that when I go to put in a US dollar amount, the result is all zeros 000.
|
|
#5
|
||||
|
||||
|
Quote:
Give me an example, I don't understand where you put the US dollar amount. Kobi Hikri. |
|
#6
|
|||
|
|||
C Helpto be honest I got off to a the wrong start in this class and really do not understand these formulas at all. I'm still in the book trying to teach myself, however I have another assignment that's due this friday that is a piggyback off of what has already been done. I would really appreciate it if you could assist me..... This is what I have to do....
Expand the “Currency Conversion” program to have a menu that allows the user to choose to which currency they wish to convert the US dollar amount. The program should loop back to the menu after each conversion until the user enters a value to exit the program. The program should display the "Currency Conversion" title, ask user for his name, ask user for US Dollar amount to convert (including name in the prompt), and then display a menu with the 5 conversion options. Once user picks a valid option, the program outputs a message with both the US dollar and equivalent amounts including the name of the currencies and only displaying two decimal places. The program must contain at least one function other than main(). Insert preambles and comments in the program to document the program internally. Create a design flow chart (Word or PowerPoint format) for the program using the flow chart symbols discussed in class. Submit the flow chart and the source code of the program, each as separate attachments. Post to the Assignments Newsgroup on Friday. (15%) This was the original assignment Write a C program that displays a title, "Currency Conversion," and then display the names of five currencies and their equivalents to $100 US dollars. The program must use named constants (for any value that remains constant), variables and equations. The program should calculate the equivalency of $100 US dollars to the Euro, Japanese Yen, UK Pound, Germany Deutsche Marc, French Franc. For purposes of this exercise, use the following conversion factors: 1 US dollar = 0.926698 Euro 1 US dollar = 6.07874 Franc 1 US dollar = 120.300 Yen 1 US dollar = 1.81246 Deutsche Marc 1 US dollar = 0.619579 Pound Once you have calculated the equivalency of $100 US dollars for each currency (using equations with variables and named constants), display the results on the screen. Be sure to label each result with the correct currency name. Before you display the 5 results, you should display "$100 US dollars is equivalent to:". Insert preambles and comments in the program to document the program internally. Create a design flow chart (Word or PowerPoint format) for the program using the flow chart symbols discussed in class. Submit the flow chart and the source code of the program, each as separate attachments. Thanks in advance for any assistance you can give me. I just wish I knew more about this stuff Quote:
|
|
#7
|
||||
|
||||
|
Pinkyy,
You need to post what you have working so far. There are many different ways to do any of these tasks. It's the one you are working on that we need to know about. Kobi cleaned up your code, did that one compile and work the way you thought it would? Since you say that it is a piggyback of the first assignment you should have some of you project already done. Show us where you stand and then people will help you from there. Mark __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs |
|
#8
|
|||
|
|||
Help From good guys :-)That formula worked, however I was not able to view it too long because I didn't know where to input the getchar statement. I'll give you what kobi gave me, as well as another code that I have. I can't thank you enough guys, really..
Kobi's code: CPP / C++ / C Code:
Quote:
Last edited by LuciWiz : 13-Sep-2005 at 01:46.
Reason: Please insert your C code between [c] & [/c] tags
|
|
#9
|
||||
|
||||
|
Pinkyy,
Go back and edit your post putting code tags around it. It is impossible to read otherwise. Instructions in This Thread. You have a little bit of time to do it before your edit time expires. Once you see how, hit edit, add the code tags and we'll go from there. Thanks, Mark The problem is that sometimes minor changes get made to your code when it is not tagged that make it hard to help. __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs |
|
#10
|
||||
|
||||
|
Ok, after a little formatting when I compile your code using gcc cygwin version on W2K I get the following.
Code:
then running it Code:
Then it goes away never to return ... Guess what, Your turn. :-) Mark __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs |
Recent GIDBlog
Python ebook by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The