⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 2-1question1.cpp

📁 This is solution code c++ in class lesson.
💻 CPP
字号:
/*
1 display menu
2 ask user to select the choice between 6 option
3 verify the choice 
  if choice 1 convert from THB to USD
     ask user to enter the amount of muney to convert
     convert the currency using the formula
     display the output
  if choice 2 convert from USD to THB
     ask user to enter the amount of muney to convert
     convert the currency using the formula
     display the output
  if choice 3 convert from USD to JPY
     ask user to enter the amount of muney to convert
     convert the currency using the formula
     display the output
  if choice 4 convert from JPY to USD
     ask user to enter the amount of muney to convert
     convert the currency using the formula
     display the output
  if choice 5 convert from THB to JPY
     ask user to enter the amount of muney to convert
     convert the currency using the formula
     display the output
  if choice 6 convert from JPY to THB
     ask user to enter the amount of muney to convert
     convert the currency using the formula
     display the output
*/
#include<iostream>
using namespace std;
int main()
{

    cout << "++++++++++++++++++++ MENU +++++++++++++++++" << endl;
    cout << "1.) convert from THB to USD" << endl;
    cout << "2.) convert from USD to THB" << endl;
    cout << "3.) convert from USD to JPY" << endl;
    cout << "4.) convert from JPY to USD" << endl;
    cout << "5.) convert from THB to JPY" << endl;
    cout << "6.) convert from JPY to THB" << endl;
    cout << "++++++++++++++++++++++++++++++++++++++++++++++" << endl;
    cout << "Enter a choice (1 - 6): ";
    int choice;
    cin >> choice;
    if (choice == 1){
       double amount;
       cout << "Enter the amount of money to be convert: ";
       cin >> amount;
       double USD = amount / 32.78;
       cout << "The amount of " << amount << " Baht is equal to " << USD << " USD" << endl;
    }else if (choice == 2){
    }else if (choice == 3){
    }else if (choice == 4){
    }else if (choice == 5){
    }else if (choice == 6){
    }else{}
    system("Pause");
    return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -