Link to home
Create AccountLog in
Avatar of alwright1975
alwright1975

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of alwright1975
alwright1975

ASKER

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