HW4updated.cpp - Currency calculation program This program...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* Currency calculation program This program displays a menu and ask user to chose one currency to convert. */ #include <iostream> #include <cmath> #include <iomanip> using namespace std; const double CANADA = 1.31; const double PESO = 16.44; const double EURO = 0.90; const double YUAN = 6.36; const double YEN = 120.53; void idFunction (int hwNum); int main () { //variable declaration int numCur; //number of currency double valCon; //value to convert double valFinal; //converted value char ans; //answer to continue or not idFunction(4); do { //Prompt for currency cout << "\nCurrency Options (Output)\n" << "1 - Canadian Dollar\n" << "2 - Chinese Yuan\n" << "3 - Euro\n" << "4 - Japanese Yen\n" << "5 - Mexican Pesos\n" << "Enter the number of the currency to convert US Dollars to: "; cin >> numCur; //input validation while (numCur <=1 || numCur >=5) { cout << "\nInvalid choice, must be 1 to 5!\n"; cout << "Currency Options (Output)\n" << "1 - Canadian Dollar\n" << "2 - Chinese Yuan\n" << "3 - Euro\n"
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern