Create a currency conversion code in a c language


Discuss the below in detail:

Q: 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. - Correctly use at least 1 function or subroutine

Permit the user to input an amount to be converted into US Dollars. You may assume that a number is input. You may not assume the value is > zero. Only values > zero are valid.

Permit the user to repeatedly perform different conversions to US Dollars. The user will be provided a way to indicate when they are done & the program will exitCurrency Conversion Program

The initial Program was created to displays 5 different countries currencies to the US Dollar Exchange rate on October 17,2005
currency to 1 US dollar.
*/

main()

{

// variables for each country for exchange rate
float usa = 1.00;
float brl = 2.2295;
float zar = 0.152952;
float mar = 0.5692;
float mep = 10.8465;
float srl = 101.5;

// results after calculations for printing
float results = 0.00;

// calculate and print results
printf("CURRENCY CONVERSION\n\n");
printf("Foreign Currency to 1 US dollar\n\n");

// Brazilian Real multiplied by 1 US dollar and printed
results = brl * usa;
printf("Brazilian Real %.3f \n", results);

// South African Rand multiplied by 1 US dollar and printed
results = zar * usa;
printf("South African Rand %.3f \n", results);

// Malaysian Ringgit multiplied by 1 US dollar and printed
results = mar * usa;
printf("Malaysian Ringgit %.3f \n", results);

// Mexican Peso multiplied by 1 US dollar and printed
results = mep * usa;
printf("Mexican Peso %.3f \n", results);

// Sri Lanka Rupee multiplied by 1 US dollar and printed
results = sar * usa;
printf("Sri Lanka Rupee %.3f \n", results);

// statement need if running in Mircle C otherwise can be commented out
getchar();

//return statement
return 0;
}

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create a currency conversion code in a c language
Reference No:- TGS01936474

Now Priced at $25 (50% Discount)

Recommended (92%)

Rated (4.4/5)