Question: Exercise 1 : Run this program and observe the results. You can input anything that you like for the dollars to be converted. Notice that
Exercise : Run this program and observe the results. You can input anything
that you like for the dollars to be converted. Notice that it has stubs as
well as overloaded functions. Study the stubs carefully. Notice that in this
case the value returning functions always return
Exercise : Complete the program by turning all the stubs into workable
functions. Be sure to call true functions differently than procedures. Make
sure that functions return the converted dollars into the proper currency.
Although the exchange rates vary from day to day, use the following
conversion chart for the program. These values should be defined as
constants in the global section so that any change in the exchange rate can
be made there and nowhere else in the program.
One Dollar euros
pesos
yen
usi#include
#include
using namespace std;
This program will input American money and convert it to foreign currency
your name
Constants for conversion rates
const double EURORATE ;
const double PESORATE ;
const double YENRATE ;
Prototypes of the functions
void convertMultifloat dollars, float& euros, float& pesos;
void convertMultifloat dollars, float& euros, float& pesos, float& yen;
float convertToYenfloat dollars;
float convertToEurosfloat dollars;
float convertToPesosfloat dollars;
int main
float dollars;
float euros;
float pesos;
float yen;
cout fixed showpoint setprecision;
cout "Please input the amount of American Dollars you want converted
endl;
cout to euros and pesos" endl;
cin dollars;
Fill in the code to call convertMulti with parameters dollars, euros, and pesos
void convertMultifloat dollars, float& euros, float& pesos;
Fill in the code to output the value of those dollars converted to both euros
and pesos
cout $ dollars is converted to euros euros, pesos pesos" endl;
cout "Please input the amount of American Dollars you want converted
;
cout to euros, pesos and yen" endl;
cin dollars;
Fill in the code to call convertMulti with parameters dollars, euros, pesos and yen
void convertMultifloat dollars, float& euros, float& pesos, float& yen;
Fill in the code to output the value of those dollars converted to euros,
pesos and yen
cout $ dollars is converted to euros euros, pesos pesos, and yen yen" endl;
cout "Please input the amount of American Dollars you want converted
;
cout to yen" endl;
cin dollars;
Fill in the code to call convertToYen
void convertToYenfloat dollars;
Fill in the code to output the value of those dollars converted to yen
cout $ dollars is converted to yen yen" endl;
cout "Please input the amount of American Dollars you want converted
;
cout to euros" endl;
cin dollars;
Fill in the code to call convert ToEuros
void convertToEurosfloat dollars;
Fill in the code to output the value of those dollars converted to euros
cout $ dollars is converted to euros euros" endl;
cout "Please input the amount of American Dollars you want converted
;
cout to pesos endl;
cin dollars;
Fill in the code to call convertToPesos
void convertToPesosfloat dollars;
Fill in the code to output the value of those dollars converted to pesos
cout $ dollars is converted to pesos pesos" endl;
return ;
All of the functions are stubs that just serve to test the functions
Replace with code that will cause the functions to execute properly
convertMulti
task: This function takes a dollar value and converts it to euros
and pesos
data in: dollars
data out: euros and pesos
void convertMultifloat dollars, float& euros, float& pesos
cout "The function convertMulti with dollars, euros and pesos
endl was called with dollars dollars" endl endl;
convertMulti
task: This function takes a dollar value and converts it to euros
pesos and yen
data in: dollars
data out: euros pesos yen
void convertMultifloat dollars, float& euros, float& pesos, float& yen
cout "The function convertMulti with dollars, euros, pesos and yen"
endl was called with dollars dollars" endl endl;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
