• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

Does this work?

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!!!

0
alwright1975
Asked:
alwright1975
1 Solution
 
jkrCommented:
Compiles and runs fine here:


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

Your choice is: 1

1.00 Euro = 1.28 US Dollar
Thank you for using the Currency Conversion program

 What problems are you running into?
0
 
alwright1975Author 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!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now