account.cpp

来自「C++上机课的习题答案」· C++ 代码 · 共 49 行

CPP
49
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?