Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

8 Update the following program. C++ data structures and algorithms Instructions:

ID: 3800598 • Letter: 8

Question

8

Update the following program. C++ data structures and algorithms

Instructions:

code to be update:

//Rate conversion program
#include<iostream>
#include<cstdlib> //for exit function
using namespace std;

//function prototypes
float dollar_to_yen(int dollar);
float dollar_to_euro(int dollar);
float dollar_to_peso(int dollar);

int main()
{
int menu,amount;
float yen, euro, peso;
cout<<"Please enter $ amount:"<<endl;
cin>>amount;
cout<<"Main Menu:"<<endl;
cout<<"Enter # to run program or quit:"<<endl;
cout<<"1) Yen Conversion"<<endl;
cout<<"2) Euro Conversion"<<endl;
cout<<"3) Peso Conversion"<<endl;
cout<<"4) All Currencies"<<endl;
cout<<"5) Quit"<<endl;
cin>>menu;

switch(menu)
{
case 1:
yen = dollar_to_yen(amount);
cout<<"You have "<<yen<<" Yen"<<endl;
break;
case 2:
euro = dollar_to_euro(amount);
cout<<"You have "<<euro<<" Euros"<<endl;
break;
case 3:
peso = dollar_to_peso(amount);
cout<<"You have "<<peso<<" Peso"<<endl;
break;
case 4:
yen = dollar_to_yen(amount);
cout<<"You have "<<yen<<" Yen"<<endl;
euro = dollar_to_euro(amount);
cout<<"You have "<<euro<<" Euros"<<endl;
peso = dollar_to_peso(amount);
cout<<"You have "<<peso<<" Peso"<<endl;
break;
case 5:
exit(1);
default:
cout<<"Wrong choice";
}//end of switch case

return 0;
}//end of main function

float dollar_to_yen(int dollar)
{
return 113.26*dollar;
}

float dollar_to_euro(int dollar)
{
return 0.93*dollar;
}

float dollar_to_peso(int dollar)
{
return dollar*21.03;
}

Update Assignment 1 Task 2. Pass the values by reference to complete the programming tasks. Using multiple functions and receiving user input. In your main function use a switch case to create a menu for the user. Create a program that converts user input in Dollars to Euro, Yen, or Peso. Prompt the user to enter amount If user input is less than or equal to zero prompt the user and stop the program. Create 4 Functions: 1) Converts and outputs conversion in Yen 2) Converts and outputs conversion in Euro 30 Converts and outputs conversion in Peso 4) Converts and outputs all 3 currencies. Update the program to accept user input for dollar amount to be converted. Attach Snipping photos of all 4 functions being executed.

Explanation / Answer

No mistakes in this program,everything is ok.just you replace the following functions to Your program.

float dollar_to_yen(int dollar)

{

return 113.58*dollar;

}

float dollar_to_euro(int dollar)

{

return 0.95*dollar;

}

float dollar_to_peso(int dollar)

{

return dollar*20.12;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote