We help IT Professionals succeed at work.

Does this work?

alwright1975
alwright1975 asked
on
226 Views
Last Modified: 2010-04-15
Here is my assignment:
Expand the ¿Currency Conversion¿ program to include a menu that allows the user to choose which currency he/she wishes to display in its equivalency to the US dollar.  Insert comments in the program to document the program internally. Attach a design flow chart and a version control sheet to the source code of the program.  
Deliverables: C source code and a MS Word document
Sample output:

Currency Conversion
Please select the currency you want to convert
1. Euro
2. UK Pound
3. Japanese Yen
4. Canadian Dollar
5. Australian Dollar
0. Quit

1.00 Euro = 1.28 US Dollar
Thanks for using the Currency Conversion program.

Here is my code:

#include <stdio.h>

main() {
    int choice;
    printf("\nCurrency Conversion\n");
    printf("Please select the currency you want to convert\n\n");
    printf("1 Euro\n");
    printf("2 UK Pound\n");
    printf("3 Japanese Yen\n");
    printf("4 Canadian Dollar\n");
    printf("5 Australian Dollar\n");
    printf("0 Quit\n\n");
   
    printf("Your choice is: ");
    scanf("%d", &choice);
   
    switch (choice) {
           case 1:
                 printf("\n1.00 Euro = 1.28 US Dollar\n");
                 printf("Thank you for using the Currency Conversion program\n");
                 break;
           case 2:
                 printf("\n1.00 UK Pound = 1.87 US Dollar\n");
                 printf("Thank you for using the Currency Conversion program\n");
                 break;
           case 3:
                 printf("\n1.00 Japanese Yen = 1.01 US Dollar\n");
                 printf("Thank you for using the Currency Conversion program\n");
                 break;
           case 4:
                 printf("\n1.00 Canadian Dollar = 0.82 US Dollar\n");
                 printf("Thank you for using the Currency Conversion program\n");
                 break;
           case 5:
                 printf("\n1.00 Australian Dollar = 0.77 US Dollar\n");
                 printf("Thank you for using the Currency Conversion program\n");
                 break;
           case 0:
                 printf("\nThank you for using the Currency Conversion program\n");
     }//switch end
}//main fuction end  
   
Can someone please take a look and tell me if I did this right and if it works for someone else as well. THANK YOU!!!

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2012
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks, I just wanted to make sure. I was have a problem with Miricle C workbench but I got it to work. Thank you!

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.