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

📄 account.cpp

📁 C++上机课的习题答案
💻 CPP
字号:
// account.cpp
//循环计算客户存取款后的帐户余额。 
#include <iostream>

using std::cout;
using std::cin;
using std::endl;
using std::fixed;

#include <iomanip>

using std::setprecision;

int main()
{
   int accountNumber; // customers account number 
   double balance; // customers balance(帐户存款)
   double charges; // charges on the account(存钱) 
   double credits; // credits to the account(取钱) 
   double limit; // credit limit on the account(取钱限额) 
   
   cout << "Enter account number (-1 to end): " << fixed;

   /* write code to read the customer's account number here */

   /* begin loop here */ {
      /* prompt and read the customer's balance here */
      /* prompt and read the customer's charges here */
      /* prompt and read the customer's credits here */
      /* prompt and read the customer's credit limit here */
      /* calculate the new customer's balance here */

      /* determine if customer's credit limit is exceeded */
      /* if customer's limit is exceeded print message */

      cout << "\nEnter account number (-1 to end): ";
      /* write code to read the customer's account number here */
   }    // end while loop

   cout << endl;  // ensure all output is displayed
   
   system("PAUSE");
   return 0;

} // end main



⌨️ 快捷键说明

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