I am creating a menu program to allow the user to do currency conversions. They will be able to decide which the original currency is and what it will be converted to. I am working on getting the text portion to work first. This is what I have so far:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/* This program will allow the user to select a country's curency and find
what the equivalent is in another. These calculations are based on the
values posted on the www.x-rates.com web site on Thursday, November 18,
2004. The site had these two items as disclaimers:
1) "The given values on this site are gathered from the Federal Reserve
Bank of New York, representing the 12 noon buying rates and the
floaternational Monetary Fund, according to their availability.
2) Values and dates are believed to be reliable but this site makes no
warranties regarding these values, fitness for a particular purpose,
accuracy or availability."
*/
main()
{
char Menu_Opt[3]; /* Menu Option */
float Org_Curr_Amt; /* Original Currency Amount */
float New_Curr_Amt; /* New Currency Amount */
char Currency_Desc[24][100] = {"American Dollar (USD)", "Australian Dollar (AUD)",
"Brazilian Real (BRL)", "British Pound (GBP)", "Canadian Dollar (CAD)",
"Chinese Yuan (CNY)", "Danish Krone (DKK)", "Euro (EUR)", "Hong Kong Dollar (HKD)",
"Indian Rupee (INR)", "Japanese Yen (JPY)", "Malaysian Ringgit (MYR)",
"Mexican Peso (MXN)", "New Zealand Dollar (NZD)", "Norwegian Kroner (NOK)",
"Singapore Dollar (SGD)", "South African Rand (ZAR)", "South Korean Won (KRW)",
"Sri Lanka Rupee (LKR)", "Swedish Krona (SEK)", "Swiss Franc (CHF)",
"Taiwan Dollar (TVD)", "Thai Baht (THB)", "Venezuelan Bolivar (YEB)"};
/* Descriptions of each of the currency types that can be converted */
printf("Currency Conversion\n");
printf("United States Dollars Conversion Menu\n\n");
printf("A01. USD to AUD\n");
printf("A02. USD to BRL Y02. Transfer to AUD Conversion Menu\n");
printf("A03. USD to GBP Y03. Transfer to BRL Conversion Menu\n");
printf("A04. USD to CAD Y04. Transfer to GBP Conversion Menu\n");
printf("A05. USD to CNY Y05. Transfer to CAD Conversion Menu\n");
printf("A06. USD to DKK Y06. Transfer to CNY Conversion Menu\n");
printf("A07. USD to EUR Y07. Transfer to DKK Conversion Menu\n");
printf("A08. USD to HKD Y08. Transfer to EUR Conversion Menu\n");
printf("A09. USD to INR Y09. Transfer to HKD Conversion Menu\n");
printf("A10. USD to JPY Y10. Transfer to INR Conversion Menu\n");
printf("A11. USD to MYR Y11. Transfer to JPY Conversion Menu\n");
printf("A12. USD to MXN Y12. Transfer to MYR Conversion Menu\n");
printf("A13. USD to NZD Y13. Transfer to MXN Conversion Menu\n");
printf("A14. USD to NOK Y14. Transfer to NZD Conversion Menu\n");
printf("A15. USD to SGD Y15. Transfer to NOK Conversion Menu\n");
printf("A16. USD to ZAR Y16. Transfer to SGD Conversion Menu\n");
printf("A17. USD to KRW Y17. Transfer to ZAR Conversion Menu\n");
printf("A18. USD to LKR Y18. Transfer to KRW Conversion Menu\n");
printf("A19. USD to SEK Y19. Transfer to LKR Conversion Menu\n");
printf("A20. USD to CHF Y20. Transfer to SEK Conversion Menu\n");
printf("A21. USD to TVD Y21. Transfer to CHF Conversion Menu\n");
printf("A22. USD to THB Y22. Transfer to TVD Conversion Menu\n");
printf("A23. USD to YEB Y23. Transfer to THB Conversion Menu\n");
printf(" Y24. Transfer to YEB Conversion Menu\n\n");
printf("Y99. Exit Program\n");
printf("Option: ");
scanf("%c", Menu_Opt);
if(Menu_Opt == "A01")
{
printf("\nPlease enter your value of %s\n", Currency_Desc[0]);
printf("\nYour Equivalent %s", Currency_Desc[1]);
printf(" is \n");
}
if(Menu_Opt == "A02")
{
printf("\nPlease enter your value of %s\n", Currency_Desc[0]);
printf("\nYour Equivalent %s", Currency_Desc[2]);
printf(" is\n");
}
)
When I run the program, I do not get the next lines to print and the program exits. Is there something wrong with my "If" logic, or what is wrong? Any help would be greatly appreciated.