Welcome![Sign In][Sign Up]
Location:
Search - SavingsAccount

Search list

[OtherC++程序设计语言实验三

Description: 实验三:C++编程入门 一、实验内容 1. 类模版。 2. 运算符重载。 3. 友元。 4. 继承。 二、实验题目 1, 设计一个类SavingsAccount,定义一个静态数据成员记录存款的年利率(rate),该类的每个成员都包含一个私有的数据成员balance,表示该成员当前的存款数额。提供一个成员函数CalMonthlyInterest(),用以计算月利息(用balance乘以rate再除以12),并将这个月利息加入balance中。提供一个静态成员函数ModifyRate(),用以改变静态数据成员rate的值。定义两个不同的SavingsAccount对象saver1和saver2,当前存款数额balance分别为2000.00和3000.00。首先将rate设置为3%,计算每个存款人的月息并打印新的结果,然后将rate设置为4%,再次计算每个存款人的月息并打印新的结果。 2, 设计一个学生类student,包括学生学号、姓名、成绩;设计一个友元函数,比较某两个学生成绩的高低;读入一个文本文件(格式如示例studengt.txt,每行的学号、姓名、成绩之间用四个空格隔开)中所有学生的学号、姓名、成绩,输出最高成绩和最低成绩的学生信息(学号、姓名、成绩)。 3, 阅读下面例子,将题中的Time类声明为Data类的友元类,通过Time类中的display函数引用Data类的私有数据,输出年、月、日和时、分、秒。 #include <iostream> using namespace std; class Date; //对Date类的提前引用声明 class Time //定义Time类 { public: Time(int,int,int); void display(Date &); //display是成员函数,形参是Date类对象的引用 private: int hour; int minute; int sec; }; class Date //声明Date类 { public: Date(int,int,int); friend void Time∷display(Date &); //声明Time中的display函数为友元成员函数 private: int month; int day; int year; }; Time∷Time(int h,int m,int s) //类Time的构造函数 { hour=h; minute=m; sec=s; } void Time∷display(Date &d) //display的作用是输出年、月、日和时、分、秒 { cout<<d.month<<″/″<<d.day<<″/″<<d.year<<endl; //引用Date类对象中的私有数据 cout<<hour<<″:″<<minute<<″:″<<sec<<endl; //引用本类对象中的私有数据 } Date∷Date(int m,int d,int y) //类Date的构造函数 { month=m; day=d; year=y; } int main( ) { Time t1(10,13,56); //定义Time类对象t1 Date d1(12,25,2004); //定义Date类对象d1 t1.display(d1); //调用t1中的display函数,实参是Date类对象d1 return 0; } 4, 将下面程序改为在类模板外定义各成员函数: #include <iostream> using namespace std; template<class numtype> //定义类模板 class Compare { public: Compare(numtype a,numtype b) { x=a;y=b; } numtype max( ) { return (x>y)?x:y; } numtype min( ) { return (x<y)?x:y; } private: numtype x,y; }; int main( ) { Compare<int> cmp1(3,7); //定义对象cmp1,用于两个整数的比较 cout<<cmp1.max( )<<″ is the Maximum of two integer numbers.″<<endl; cout<<cmp1.min( )<<″ is the Minimum of two integer numbers.″<<endl<<endl; Compare<float> cmp2(45.78,93.6); //定义对象cmp2,用于两个浮点数的比较 cout<<cmp2.max( )<<″ is the Maximum of two float numbers.″<<endl; cout<<cmp2.min( )<<″ is the Minimum of two float numbers.″<<endl<<endl; Compare<char> cmp3(′a′,′A′); //定义对象cmp3,用于两个字符的比较 cout<<cmp3.max( )<<″ is the Maximum of two characters.″<<endl; cout<<cmp3.min( )<<″ is the Minimum of two characters.″<<endl; return 0; } 5, 有两个矩阵a和b,均为2行3列,求两个矩阵的和。重载运算符“+”使之用于矩阵相加。如:c=a+b。重载插入运算符“<<”和流提取运算符“>>”,使之能用于该矩阵的输入和输出。 6, 利用类继承分别完成一个学生类、一个大学生类、一个本科生类,本科生类中包括了一个学生作为他的班长。在创建一个本科生对象时赋予他的全部信息,输出该本科生对象的全部信息。 7, 利用c++继承、多态虚函数、构造函数完成以下程序:设计人、老师、学生、大学生、研究生、大四学生等类、其主要属性自己定义,要求包括以下方法: 1) 构造函数,创建对象的主要信息 2) Display,显示每种类对象的主要信息 此外,要求每个类包含一个生日对象,其类型为Birthday类,学生类应该包含一个班主任对象,其类型为老师类。 三、实验要求  将程序源代码压缩后提交至学院FTP上对应实验和班级的目录中。  作业命名方式为:“学号姓名.rar”。  作业提交时间:下次实验课前提交。
Platform: | Size: 1255695 | Author: zhuchao0731@163.com | Hits:

[Multimedia Developex11

Description: 1. 设计一个类SavingsAccount,定义一个静态数据成员记录存款的年利率(rate),该类的每个成员都包含一个私有的数据成员balance,表示该成员当前的存款数额。提供一个成员函数CalMonthlyInterest(),用以计算月利息(用balance乘以rate再除以12),并将这个月利息加入balance中。提供一个静态成员函数ModifyRate(),用以改变静态数据成员rate的值。定义两个不同的SavingsAccount对象saver1和saver2,当前存款数额balance分别为2000.00和3000.00。首先将rate设置为3 ,计算每个存款人的月息并打印新的结果,然后将rate设置为4 ,再次计算每个存款人的月息并打印新的结果。-1. To design a type SavingsAccount, define a static data member of record of deposits interest rate (rate), every member of the class contains a private data member balance, that the members of the current amount of the deposit. Member functions to provide a CalMonthlyInterest (), for the purpose of calculating interest on (with balance multiplied by the rate divided by 12), and this month joined the balance of interest. Provide a static member function ModifyRate (), to change the static data members of the value of rate. SavingsAccount definition of two different objects saver1 and saver2, the current deposit balance amount of 2000.00 and 3000.00, respectively. First rate is set to 3 , calculated for each of the monthly interest of depositors and print new results, and then rate is set to 4 , again calculated for each of the monthly interest of depositors and print new results.
Platform: | Size: 1024 | Author: sngah | Hits:

[Otherinheritance

Description: 与继承有关的程序(含测试)(包括DateandTime、HugeInteger、LinearList、Rational、Rectangle、SavingsAccount)-With the succession-related procedures (including testing)
Platform: | Size: 7168 | Author: Crystal | Hits:

[OS programSavingsAccount

Description: 实现银行存取款以及利息计算功能的一个类,以及简单调用以测试功能-Bank deposit and withdrawal and interest to achieve computing capabilities of a class, and a simple call to test the functionality
Platform: | Size: 1024 | Author: danyue | Hits:

[Windows Developex5_1

Description: 1,设计一个类SavingsAccount,定义一个静态数据成员记录存款的年利率(rate),该类的每个成员都包含一个私有的数据成员balance,表示该成员当前的存款数额。提供一个成员函数CalMonthlyInterest(),用以计算月利息(用balance乘以rate再除以12),并将这个月利息加入balance中。提供一个静态成员函数ModifyRate(),用以改变静态数据成员rate的值。定义两个不同的SavingsAccount对象saver1和saver2,当前存款数额balance分别为2000.00和3000.00。首先将rate设置为3 ,计算每个存款人的月息并打印新的结果,然后将rate设置为4 ,再次计算每个存款人的月息并打印新的结果。-1, the design of a class SavingsAccount, define a static data member records of deposits interest rate (rate), each member of the class contains a private data member balance, said the members of the current deposit amount. A member function CalMonthlyInterest (), to calculate the monthly interest (rate multiplied with the balance divided by 12), and this month joined the balance of interest. Provide a static member function ModifyRate (), used to change the value of the static data member rate. SavingsAccount define two different objects saver1 and saver2, the current deposit balance amount of 2000.00 and 3000.00, respectively. First, the rate is set to 3 monthly interest rate calculated for each depositor and print new results, and then rate is set to 4 , re-calculate the monthly interest of each depositor and print new results.
Platform: | Size: 567296 | Author: tangyao | Hits:

[Software Engineeringsavingaccount

Description: 设计一个类SavingsAccount,定义一个静态数据成员记录存款的年利率(rate),该类的每个成员都包含一个私有的数据成员balance,表示该成员当前的存款数额。提供一个成员函数CalMonthlyInterest(),用以计算月利息(用balance乘以rate再除以12),并将这个月利息加入balance中。提供一个静态成员函数ModifyRate(),用以改变静态数据成员rate的值。定义两个不同的SavingsAccount对象saver1和saver2,当前存款数额balance分别为2000.00和3000.00。首先将rate设置为3 ,计算每个存款人的月息并打印新的结果,然后将rate设置为4 ,再次计算每个存款人的月息并打印新的结果。-Design a class SavingsAccount, define a static data member records of deposits interest rate (rate), every member of the class contains a private data member balance, said the members of the current deposit amount. A member function CalMonthlyInterest (), to calculate the monthly interest (rate multiplied with the balance divided by 12), and this month joined the balance of interest. Provide a static member function ModifyRate (), used to change the value of the static data member rate. SavingsAccount define two different objects saver1 and saver2, the current deposit balance amount of 2000.00 and 3000.00, respectively. First, the rate is set to 3 monthly interest rate calculated for each depositor and print new results, and then rate is set to 4 , re-calculate the monthly interest of each depositor and print new results.
Platform: | Size: 1024 | Author: name | Hits:

[Finance-Stock software systemSavingsAccount

Description: 模拟了一个简易的银行系统,以此来熟悉C++中对于类的使用-Simulation of a simple banking system, in order to become familiar with C++ for class use
Platform: | Size: 309248 | Author: 欧发欣 | Hits:

[Finance-Stock software systemsavingsaccount

Description: 一个小的银行储蓄账户程序,针对储户排队时间以及不同存款年限-A bank savings account program for depositors queuing time and the different deposits time
Platform: | Size: 927744 | Author: kite | Hits:

[Finance-Stock software systemcSharpchuxuchengxu

Description: 假设你是一家银行的工作人员。要求你为帐户的类型定义对象。这些帐户是活期帐户(CheckingAccount)和储蓄存款帐户(SavingsAccount)。活期帐户具有以下特征:帐户持有者的名字只能在创建帐户时指定;初始金额必须在帐户创建时指定;帐户创建时必须分配帐户号。活期帐户的帐户号范围是从1000到4999,每个帐户必须具有唯一的帐户号。(不必检查帐户号的正确性)。活期帐户持有者能够:往帐户中加钱;如果帐户里资金充足,可以从中取钱。 储蓄存款帐户具有以下特征:帐户持有者的名字只能在创建帐户时指定;初始金额必须在帐户创建时指定;帐户创建时必须分配帐户号。储蓄存款帐户的帐户号范围是从5000到9999,每个帐户必须具有唯一的帐户号。(不必检查帐户号的正确性)。储蓄存款帐户持有者能够:往帐户中加钱;如果帐户里资金充足,可以从中取钱;帐户可以赚取利息,利率取决于帐户余额。如果余额大于1000,利息率是6 ,否则是3 。 -Suppose you are a bank s staff. Account object type definition. These accounts are the current account (CheckingAccount) and savings accounts (the SavingsAccount). The current account has the following characteristics: the name of the account holder can only be specified when creating an account initial amount must be specified when the account was created account creation must be assigned an account number. Current Account Account number range from 1000 to 4999, each account must have a unique account number. (Do not have to check the correctness of the account number). The current account holders can: add money to the account sufficient funds in the account, you can withdraw money. The savings account has the following characteristics: the name of the account holder can only be specified when creating an account initial amount must be specified when the account was created account creation must be assigned an account number. Savings account account number range from 5000 to 999
Platform: | Size: 1024 | Author: 陈晓磊 | Hits:

[source in ebooksaving-account

Description: 创建SavingsAccountclass。使用StaticData部分成员存储theannualInterestRateto店每年提取的每个储户的利率。每个类的成员包含privatedata的的成员savingsBalanceindicating金丹目前有存款量。提供一个成员函数calculateMonthlyInterestmember的功能,计算由乘以12 balancebyannualInterestRatedivided的月息 ,这种兴趣应加savingsBalance的。提供一个staticmember功能modifyInterestRatethat的的设置静态annualInterestRateto的一个新值。写类SavingsAccount的adriver程序测试。实例化两个不同的对象类SavingsAccount,saver1and saver2的结余为$2000.00和3000.00美元的,分别。设置annualInterestRateto3percent,然后计算出每月利息,并为每个储户打印新的结余。然后设置theannualInterestRateto4%,计算出下个月的利息和eachof运算储户打印新的结余。-H12 H12 Create a SavingsAccountclass. Use a staticdata member to store theannualInterestRateto store theannual interest rate for each of the savers. Each member of the class contains a privatedata member savingsBalanceindicating the amount the saver currently has on deposit. Provide a member function calculateMonthlyInterestmember function that calculates the monthly interest by multiplying the balancebyannualInterestRatedivided by 12 this interest should be added to savingsBalance. Provide a staticmember function modifyInterestRatethat sets the static annualInterestRateto a new value. Write adriver program to test class SavingsAccount. Instantiate two different objects of class SavingsAccount,saver1and saver2, with balances of $2000.00 and $3000.00, respectively. Set annualInterestRateto 3percent, then calculate the monthly interest and print the new balances for each of the savers. Then set theannualInterestRateto 4 percent, calculate the next month’s interest and print the new ba
Platform: | Size: 1024 | Author: 张国 | Hits:

[DocumentsSavingsAccount

Description: 设计一个类SavingsAccount,定义一个静态数据成员记录存款的年利率(rate),该类的每个成员都包含一个私有的数据成员balance,表示该成员当前的存款数额。提供一个成员函数CalMonthlyInterest(),用以计算月利息(用balance乘以rate再除以12),并将这个月利息加入balance中。提供一个静态成员函数ModifyRate(),用以改变静态数据成员rate的值。定义两个不同的SavingsAccount对象saver1和saver2,当前存款数额balance分别为2000.00和3000.00。首先将rate设置为3 ,计算每个存款人的月息并打印新的结果,然后将rate设置为4 ,再次计算每个存款人的月息并打印新的结果。-(SavingsAccount Class) Create a SavingsAccount class. Use a static data member annual- InterestRate to store the annual interest rate for each of the savers. Each member of the class contains a private data member savingsBalance indicating the amount the saver currently has on deposit. Provide member function calculateMonthlyInterest that calculates the monthly interest by multiplying the balance by annualInterestRate divided by 12 this interest should be added to savingsBalance. Provide a static member function modifyInterestRate that sets the static annualInterestRate to a new value. Write a driver program to test class SavingsAccount. Instantiate two different objects of class SavingsAccount, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set the annualInterestRate to 3 percent. Then calculate the monthly interest and print the new balances for each of the savers. Then set the annualInterestRate to
Platform: | Size: 1024 | Author: 王梓侨 | Hits:

[Software EngineeringSavingsAccount

Description: 实现银行卡操作的基本功能,银行卡的存储实现,以及银行卡的利息和日期方面的计算。-To achieve the basic functions of bank card operation, storage implementation bank cards, as well as calculation of interest and the dates of bank cards.
Platform: | Size: 7168 | Author: Adifeir Dec | Hits:

[ADO-ODBCSavingsAccount

Description: 实现银行存取款以及利息计算功能的一个类,以及简单调用以测试功能-Bank deposit and withdrawal and interest to achieve computing capabilities of a class, and a simple call to test the functionality
Platform: | Size: 2048 | Author: iiu2u00shizi | Hits:

[ADO-ODBCSavingsAccount

Description: 实现银行存取款以及利息计算功能的一个类,以及简单调用以测试功能-Bank deposit and withdrawal and interest to achieve computing capabilities of a class, and a simple call to test the functionality
Platform: | Size: 1024 | Author: xubmbba | Hits:

CodeBus www.codebus.net