C++ Projects

已完成 已发布的 7 年前 货到付款
已完成 货到付款

This Account Inheritance Hierarchy must have 3 classes. The base class is Account. One data member called balance of data type double. A constructor that takes one parameter to initialize the data member balance. The constructor should validate the initial balance to make sure it is more than 0. If the initial balance is less than zero, then set the balance to zero and display an error message. A member function called credit to allow the user to add value to the balance. The function should take one parameter and return the new balance. A member function called debit to allow the user to withdraw money from the account. The function should check if there is sufficient fund for the withdrawal. The function should take one parameter (the amount of withdrawal) and return true/false (Boolean data type) to indicate the success or failure of the transaction, respectively. Display an error message if there isn’t sufficient fund for the withdrawal. A member function getBalance to return the account’s current balance. A member function setBalance to re-initialize the account’s balance. The class SavingAccount is a class derived from the class Account. The SavingAccount inherits all data members and functions from the base class Account. An additional data member of type double indicating the interest rate (percentage) assigned to the account. A constructor that receives the initial balance, as well as an initial value for the SavingsAccount’s interest rate. A member function calculateInterest that returns a double indicating the amount of interest earned by the account. This member function should not increase the account’s balance. A member function setInterest to re-set the account’s interest rate. A member function getInterest to return the Account’s current interest rate. The class CheckingAccount is a class derived from the class Account The CheckingAccount class inherits all data members and functions from the class Account. An additional data member of type double that represents the fee charged for the account. A constructor that receives the initial balance, as well as a parameter indicating a fee amount. A member function Chargefee that reduces the account balance by the amount of the fee. The function should return true if the fee is charged and false otherwise. Use the value returned from the function to display a message indicating if a fee has been charged or not. A member function setFee to change account’s fee. A member function getFee to return the account’s current fee. After defining the classes in this hierarchy, write a program that creates objects of each class and tests their member functions. Add interest to the SavingsAccount object by first invoking its calculateInterest function, then passing the returned interest amount to the object’s credit function.

C++编程

项目ID: #11463549

关于项目

5个方案 远程项目 活跃的7 年前

授予:

vano101

I have updated my bid! .

$20 USD 在1天内
(732条评论)
7.0

有5名威客正在参与此工作的竞标,均价$21/小时

xeathprynx

Hello, i am expert in java/c/c++ and i can deliver any task in least time and least payments. The code will be well commented and well formatted for better understanding. I believe in long term relations so first che 更多

$25USD 在1天里
(40条评论)
4.5
dynalgotech

We are working on C/C++ for last few years. Can we discuss over chat?

$25USD 在1天里
(1条评论)
2.3
FaizanAhmed14

Hello, read your description and want you to know that i have been working into c++ for more than 4 years with numerous projects in portfolio. From small mini games to complex management systems i have done it all. So 更多

$21USD 在1天里
(1条评论)
1.1