Question: I need a c++ program that converts U.S dollar amount to Zambian Kwacha, Belize, and Hong Kong dollars. I have the following code, but its
I need a c++ program that converts U.S dollar amount to Zambian Kwacha, Belize, and Hong Kong dollars. I have the following code, but its not working corrrectly.
#include
#include
using namespace std;
int main()
{
const double ZAMBIANKWACHA_PER_DOLLAR = 9950;
const double BELIZE_PER_DOLLAR = 2.10;
const double HONG_KONG_PER_DOLLAR = 7.76;
double dollars, zambiankwacha, belize, hongkong;
cout << setprecision(2) << fixed;
cout << "Enter dollar amount: ";
cin >> dollars;
zambiankwacha = dollars * ZAMBIANKWACHA_PER_DOLLAR;
belize = dollars * BELIZE_PER_DOLLAR;
hongkong = dollars * HONG_KONG_PER_DOLLAR;
cout << "-------Conversion------- ";
cout << "$" << dollars << " = " << zambiankwacha << " zambiankwacha ";
cout << "$" << dollars << " = " << belize << " belize ";
cout << "$" << dollars << " = " << hongkong << "Hong Kong " ;
system("pause");
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
