Need to solve this question in C++ Write a program that will display the followi
ID: 3868284 • Letter: N
Question
Need to solve this question in C++ Write a program that will display the following output. First, the user will select the currency to be converted and enter input MYR value by blank. The value will be displayed in currency chosen. Explain your software/program in a flow chart and discuss the advantages and disadvantages of your program. Include suggestions for future improvements in the assignment. Example: The program is to convert Malaysia Ringgit (MYR) to other currencies. Currency converter Singapore Dollar (SGD) United States Dollar (USD) Australia Dollar(AUD) Euro (EUR) India Rupee (INR) Please enter your choice (1-5) to be converted: _____ 2 _____ Please enter MYR value: _____ 1000 _____ The value in Australia Dollar (AUD) is: AUD _____ 232.59 _____.Explanation / Answer
/*include the library*/
#include <stdio.h>
/*main function of the program*/
int main()
{
/*declare variables*/
float us;
float conversion;
int choice;
/*show options to user*/
printf("Currency Converter ");
printf("---------------------------- ");
printf("Press number 1 to 5 to select a currency to convert ");
printf("Press [1] for Singapore Dolar ");
printf("Press [2] for United States Dolar ");
printf("Press [3] for Australia Dolar ");
printf("Press [4] for Euro ");
printf("Press [5] for India Rupee ");
/*store choice in memory*/
scanf("%d", &choice);
/*prompt user to enter amount toconvert*/
printf("Please enter MYR Value: ");
/*store user entry into memeory*/;
scanf("%f",&us);
if(choice==1){
conversion=0.32*us;
printf("The value in Singapore Dolar is:SGD-- $%.2f ", conversion);
}
else if(choice==2){
conversion=0.23*us;
printf("The value in United States Dolar is:USD-- $%.2f ", conversion);
}
else if(choice==3){
conversion=0.29*us;
printf("The value in Australia Dolar is:AUD-- $%.2f ", conversion);
}
else if(choice==4){
conversion=0.20*us;
printf("The value in Euror is:EUR-- $%.2f ", conversion);
}
else if(choice==5){
conversion=14.95*us;
printf("The value in India Rupee is:INR-- $%.2f ", conversion);
}
/*display results*/
getchar();
/*terminate program*/
}
-------------------------------------------------------
Output:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.