Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void show_menu();
- void converter_rub2usd();
- void converter_usd2rub();
- void children() {
- int k = 0;
- //cout << "Enter ";
- //cin >> k;
- while(k < 10) {
- cout << k << " ";
- k++;
- }
- cout << endl;
- }
- void bill() {
- int summ = 0;
- int price;
- int n = 0;
- while (n < 4) {
- cout << "Enter " << n << " product ";
- cin >> price;
- summ += price;
- n++;
- }
- cout << "TOTAL: " << summ << endl;
- }
- const double price_usd_rub = 91.51;
- void converter_rub2usd() {
- double rub, usd;
- cout << "Enter numbers of rub for covert to usd: ";
- cin >> rub;
- usd = rub / price_usd_rub;
- cout << "You can take " << usd << " usd" << endl;
- }
- void converter_usd2rub() {
- double rub, usd;
- cout << "Enter numbers of usd for covert to rub: ";
- cin >> usd;
- rub = usd * price_usd_rub;
- cout << "You can take " << rub << " rub" << endl;
- }
- void show_menu() {
- cout << endl;
- cout << " Converter Money " << endl;
- cout << endl;
- cout << " 1. Convert rub to usd." << endl;
- cout << " 2. Convert usd to rub." << endl;
- cout << " 0. Exit." << endl;
- int mode = 1;
- while (mode > 0) {
- cin >> mode;
- if (mode == 1) {
- converter_rub2usd();
- }
- if (mode == 2) {
- converter_usd2rub();
- }
- cout << "Enter 0 for exit" << endl;
- }
- cout << endl;
- }
- int main() {
- //children();
- //bill();
- //converter_money();
- show_menu();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment