Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CAN PLEASE FIX THE PROBLEM IN THIS C++ CODE AND TELL ME WHAT IS WRONG WITH IT? #include #include using namespace std; // This program

CAN PLEASE FIX THE PROBLEM IN THIS C++ CODE AND TELL ME WHAT IS WRONG WITH IT?

#include  #include  using namespace std; // This program will input American money and convert it to foreign currency // BERKER ERDINI // Prototypes of the functions float dollars; float euros; float pesos; float yen; void convertMulti(float dollars, float& euros, float& pesos); void convertMulti(float dollars, float& euros, float& pesos, float& yen); float convertToYen(float dollars); float convertToEuros(float dollars); float convertToPesos(float dollars); int main() { cout << fixed << showpoint << setprecision(2); 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 convertMulti(float dollars, float& euros, float& pesos); // Fill in the code to output the value of those dollars converted to both euros // and pesos 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 convertMulti(float 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: " << dollars << endl; cout << "Euros: " << euros << endl; cout << "Pesos: " << pesos << endl; cout << "Yens: " << 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 float convertToYen(float dollars); // Fill in the code to output the value of those dollars converted to yen cout << "Dollars: " << dollars << endl; cout << "Yens: " << 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 float convertToEuros(float dollars); // Fill in the code to output the value of those dollars converted to euros cout << "Dollars: " << dollars << endl; cout << "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 float convertToPesos(float dollars); // Fill in the code to output the value of those dollars converted to pesos cout << "Dollars: " << dollars << endl; cout << "Pesos: " << pesos << endl; return 0; } // 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 convertMulti(float dollars, float& euros, float& pesos) { float euroRate = 0.86; float pesoRate = 18.84; euros = dollars * euroRate; pesos = dollars * pesoRate; // 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 convertMulti(float dollars, float& euros, float& pesos, float& yen) { float euroRate = 0.86; float pesoRate = 18.84; float yenRate = 112.06; euros = dollars * euroRate; pesos = dollars * pesoRate; yen = dollars * yenRate; //cout << "The function convertMulti with dollars, euros, pesos and yen" // << endl << " was called with " << dollars << " dollars" << endl << endl; } // **************************************************************************** // convertToYen // // task: This function takes a dollar value and converts it to yen // data in: dollars // data returned: yen // // *************************************************************************** float convertToYen(float dollars, float& yen) { float yenRate = 112.06; yen = dollars * yenRate; //cout << "The function convertToYen was called with " << dollars << " dollars" // << endl << endl; return 0; } // **************************************************************************** // convertToEuros // // task: This function takes a dollar value and converts it to euros // data in: dollars // data returned: euros // // **************************************************************************** float convertToEuros(float dollars, float& euros) { cout << "The function convertToEuros was called with " << dollars << " dollars" << endl << endl; return 0; } // ***************************************************************************** // convertToPesos // // task: This function takes a dollar value and converts it to pesos // data in: dollars // data returned: pesos // // **************************************************************************** float convertToPesos(float dollars, float& pesos) { cout << "The function convertToPesos was called with " << dollars << " dollars" << endl; return 0; 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

2nd Edition

1597499471, 978-1597499477

More Books

Students also viewed these Databases questions

Question

Lo6 Identify several management development methods.

Answered: 1 week ago