本文整理汇总了C++中BankAccount::printHistory方法的典型用法代码示例。如果您正苦于以下问题:C++ BankAccount::printHistory方法的具体用法?C++ BankAccount::printHistory怎么用?C++ BankAccount::printHistory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BankAccount
的用法示例。
在下文中一共展示了BankAccount::printHistory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pal
BankHis::BankHis(QWidget *parent) :
QWidget(parent),
ui(new Ui::BankHis)
{
ui->setupUi(this);
QPixmap pix = QPixmap("img.jpg").scaled(this->size());
QPalette pal(this->palette());
pal.setBrush(QPalette::Background,QBrush(pix));
this->setPalette(pal);
this->setWindowOpacity(0.9);
BankAccount *bac = new BankAccount;// = new BankAccount;
QString hist = QString::fromStdString(bac->printHistory());
QLabel *his = new QLabel(hist);
ui->s->setWidget(his);
bac->~BankAccount();
}
示例2: mainMenu
//.........这里部分代码省略.........
cin.ignore();
cin >> minPrice;
}
stockObj.sellStock(&Node(stockSymbol, numberShare), minPrice);
break;
case 5:
// view matlab graph
cout << "\nPlease select the time period in the graph: " << endl;
cout << "Start Date (mm/dd/yyyy): ";
cin >> time_start;
cout << "\nEnd Date (mm/dd/yyyy): ";
cin >> time_end;
stockObj.viewGraph(time_start, time_end);
break;
case 6:
// view transaction history
stockObj.viewHistory();
break;
} // end stock switch
} while ( stockChoice != 7 );
break;
} // end case 1
case 2:
{
// bank menu
cout << "\nBank Account" << endl;
// update balance
bankObj.setBalance(stockObj.getBalance());
int bankChoice; // choice for bank menu
double amount; // amount of money to deposit or withdraw
do {
bankInstruction();
cin >> bankChoice;
while (cin.fail()){
cout << "\nPlease enter an integer value: ";
cin.clear();
cin.ignore();
cin >> bankChoice;
}
switch ( bankChoice ) {
case 1:
// view account balance
bankObj.viewBalance();
break;
case 2:
// deposit
cout << "Please select the amount you wish to deposit: $";
cin >> amount;
while (cin.fail()){
cout << "\nPlease enter a double value: $";
cin.clear();
cin.ignore();
cin >> amount;
}
bankObj.deposit(amount);
break;
case 3:
// withdraw
cout << "Please select the amount you wish to withdraw: $";
cin >> amount;
while (cin.fail()){
cout << "\nPlease enter a double value: $";
cin.clear();
cin.ignore();
cin >> amount;
}
bankObj.withdraw(amount);
break;
case 4:
// print history
bankObj.printHistory();
break;
} // end bank switch
} while ( bankChoice != 5 );
break;
} // end case 2
} // end main switch
} while ( mainChoice != 3 );
}