Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // tryingInterface.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #define _USE_MATH_DEFINES
- #include <math.h>
- #include <iomanip>
- #include <string>
- using namespace std;
- int main()
- {
- float inputMoney;
- string enterCurrency, exitCurrency;
- float enterCu = 0;
- float exitCu = 0;
- float result = 0;
- cin >> inputMoney >> enterCurrency >> exitCurrency;
- if (enterCurrency == "BGN")
- {
- enterCu = 1;
- }
- else if (enterCurrency == "USD" )
- {
- enterCu = 1.79549;
- }
- else if (enterCurrency == "EUR")
- {
- enterCu = 1.95583;
- }
- else if (enterCurrency == "GBP")
- {
- enterCu = 2.53405;
- }
- if (exitCurrency == "BGN")
- {
- exitCu = 1;
- }
- else if (exitCurrency == "USD")
- {
- exitCu = 1.79549;
- }
- else if (exitCurrency == "EUR")
- {
- exitCu = 1.95583;
- }
- else if (exitCurrency == "GBP")
- {
- exitCu = 2.53405;
- }
- result = inputMoney * enterCu / exitCu;
- cout << fixed << setprecision(2) << result <<" "<< exitCurrency << endl;;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement