-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCurrencyConverter-Program
35 lines (29 loc) · 1.36 KB
/
CurrencyConverter-Program
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//******************************************************************************************************************************
//
// File: CurrencyConverter.cpp
// Student: Alec Ochoa Michaud
// Programing challenge: Starting Out With C++, page 181 exersice 12.
// Write a program that ask the user to enter the number of dollars he/she wishes to
// convert to yens, the for euros. The currency value are fixed to 1 Dollar = .952 Yen
// and .7175 Euros, however, you can ask the user enter the current exchange rate.
//
//*******************************************************************************************************************************
#include <iostream>
using namespace std;
int main() {
//Expected values.
double dollar1, yen_per_dollar, dollar2, euro_per_dollar;
//Dollar to Yen
cout<<"Type the amount of dollars you want to change for yens. ";
cin>> dollar1;
yen_per_dollar = dollar1*.952;
cout << endl;
cout<< "You can get: " << yen_per_dollar << " yen.";
//Dollar to euro.
cout<<"\n\nType the amount of dollars you want to change for euros. ";
cin>>dollar2;
euro_per_dollar = dollar2 * .7175;
cout << endl;
cout<<"You can get: " <<euro_per_dollar << " euros.";
return 0;
}