Hello I'm new to the language and i'm in a course that's going 1 million miles per hour, could someone help me or guide me in the rite direction to complete the following exercise (I have weekly exercises that are suppose to help you out by directing you in task but we don't go over them in class so it's kind of backwards if you ask me.)
I'm trying to complete the following:
Create a class definition for an object called Account. Add a constructor and destructor to it.
Create a class CheckingAccount and make it a child class of Account.
Create a second class named Savings account and also make this class a derived class of Account.
Create private data members on the derived classes to represent balance and overdraft limits.
Implement the following class methods on classes that you think are the appropriate ones.
Write a main function that instantiates a checking and savings account, and then deposit $100 into each account and set an overdraft limit on the checking account of $50.
class Account // create Account class
{
....
Account(); // Constructor
~Account(); // Destructor notice the ~
}
class CheckingAccount: public Account
{
... // Some code here
}
class Savings: public Account
{
... // some code here
}
/*
Definitions go here
*/
i tried to take a screen shot of what i had as of rite now and it wouldn't let me paste I have something similar to whats posted and i've come to the conclusion of what is all needed but i'm just having issues formatting.
//Homework for week 1
//Create a class definition for an object called Account. Add a constructor and destructor to it.
//Create a class CheckingAccount and make it a child class of Account.
//Create a second class named Savings account and also make this class a derived class of Account.
//Create private data members on the derived classes to represent balance and overdraft limits.
//Implement the following class methods on classes that you think are the appropriate ones.
//getBalance
//getAnnualInterestRate
//withdraw
//deposit
//getMonthlyInterest
//Write a main function that instantiates a checking and savings account, and then deposit $100 into each account and set an overdraft limit on the checking account of $50.
i have the following
//getBalance-Base
//getAnnualInterestRate-Savings
//withdraw-Base
//deposit-Base
//getMonthlyInterest-Savings
not sure if you seen what i have written so far i apologize i tried to do a screen cap but it wouldn't let me paste it in. When i said formatting I'm referring to the order in which everything should be typed out if that makes any sense