account.tex.old
来自「国外的数据结构与算法分析用书」· OLD 代码 · 共 47 行
OLD
47 行
\begin{program}
\PACKAGE\ Accounts;\\
\IMPORT\ People.Customer;\\
\\[\emptyline]
\textrm{/**}\>\textrm{Bank account for customers.}\\
\>\textrm{This class contains attributes that are common to all types of accounts. */}\\
\PUBLIC\ \ABSTRACT\ \CLASS\ Account\\
$\{$\\
\>\textrm{/**}\>\textrm{The account holder */}\\
\>\PROTECTED\ Customer owner; \\
\\[\emptyline]
\>\textrm{/**}\>\textrm{A unique number for each account */}\\
\>\PROTECTED\ \INT\ number; \\
\\[\emptyline]
\>\textrm{/**}\>\textrm{Amount of money in the acocunt */}\\
\>\PROTECTED\ \FLOAT\ balance; \\
\\[\emptyline]
\>\textrm{/**}\>\textrm{Create a new account with a customer and a number */}\\
\>\PUBLIC\ Account(Customer c, \INT\ n)\\
\>$\{$\\
\>\>owner = c;\\
\>\>number = n;\\
\>$\}$\\
\\[\emptyline]
\>\textrm{/**} \textrm{ Return the owner of this account */}\\
\>\PUBLIC\ Customer owner()\\
\>$\{$\\
\>\>\RETURN\ owner;\\
\>$\}$\\
\\[\emptyline]
\>\textrm{/**}\>\textrm{Return the account number */}\\
\>\PUBLIC\ \INT\ number()\\
\>$\{$\\
\>\>\RETURN\ number;\\
\>$\}$\\
\\[\emptyline]
\>\textrm{/**}\>\textrm{Return the account balance */} \\
\>\PUBLIC\ \FLOAT\ balance()\\
\>$\{$\\
\>\>\RETURN\ balance;\\
\>$\}$\\
\\[\emptyline]
\>\textrm{/**}\>\textrm{Generate a listing of account activity */}\\
\>\PUBLIC\ \ABSTRACT\ String generateMonthlyStmt();\\
$\}$\\
\end{program}
\vspace{\backup}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?