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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
// I'm limited to these libraries.
#include <iostream>
#include <vector>
double currencyRates() {
std::vector<double> rates = {1, 103.30, 0.89, 6.33, 4.06, 1198.94};;
}
double userValue (double firstCurrency, double secondCurrency) {
double totalValue = firstCurrency * secondCurrency;
return totalValue;
}
void print(std::vector<std::string> const &input) {
for (int i = 0; i < input.size(); i++) {
std::cout << input.at(i) << ", ";
}
}
int main() {
std::vector<std::string> nations = {"United States", "Afghanistan", "France", "China", "Poland", "South Korea"};;
std::vector<std::string> nationCurrencies = {"Dollars", "Afghan afghani", "Euro", "Yuan", "Złoty", "Won"};;
int currencyCurrent = 0;
std::string date = "January 25, 2022";
double userCurrency;
int userMoney;
std::cout << "Here is a list of nations available: \n";
print(nations);
std::cout << "\nAnd here are there currencies: \n";
print(nationCurrencies);
std::cout << "\nWhat currency would you like to convert to?\n";
std::cin >> userCurrency;
std::cout << "How many US dollars (and cents) do you want to convert?\n";
std::cin >> userMoney;
double userValue(userMoney, double currencyRates());
}
| |