Thursday 5 January 2017

On a certain day the British pound was equivalent to $1.487 U.S., the French franc was $0.172, the German deutsche mark was $0.584, and the Japanese yen was $0.00955. Write a program that allows the user to enter an amount in dollars, and then displays this value converted to these four other monetary units.

Leave a Comment


Question:

On a certain day the British pound was equivalent to $1.487 U.S., the French franc was $0.172, the German deutsche mark was $0.584, and the Japanese yen was $0.00955. Write a program that allows the user to enter an amount in dollars, and then displays this value converted to these four other monetary units.

Explanation:
Below mention code is compiled in Visual Studio 2015 and Code Blocks 13.12,output snap is attached.. If any problem you feel and you want some explanation feel free to contact us.

Code:

/**************************************************|
/*************C++ Programs And Projects************|
***************************************************/
#include <iostream>
using namespace std;
int main()
{
       float ammount=0, british = 1.487, franc = 0.172, deutsche = 0.584, yen = 0.00955;
       cout << "Enter the ammount in US Dollar == ";
       cin >> ammount;
       cout << "British == " << ammount*british << endl
              << "French == " << ammount*franc << endl
              << "German == " << deutsche*ammount << endl
              << "Japanese == " << ammount*yen << endl;
       return 0;

}

Output:



Related Articles:

Object-Oriented Programming in C++ Fourth Edition By Robert Lafore Solution Manual

C++ Books Solution

If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: