Part 1-2 marks
Q1) Write a program using the object-oriented paradigm that keeps track of bank accounts. Each class should have constructor and destructor methods but the choice of members will be up to you. Start with a class for ‘account’ and then allow for different types of derived classes, such as ‘savings account’ and ‘credit card account.’ A bank account should allow funds to be added to it as well as withdrawn but not to be overdrawn. A credit card account should allow funds to be charged to it but not more than its limit. In the main() function, open a savings account with $10,000 and then make three withdrawals of $4,000, if there are enough funds. Open a credit card account, with a limit of $3000 and make two charges of $2000 if there are enough funds. If you breach the conditions for each, display an appropriate error message.
Q2) Write a program using functions with parameters and return value with following requirements.
Ask the user to enter two numbers(If you want to add extra functionality you can provide validations.)
Ask the user to enter a choice.
If the user enters + then the function to add the numbers should be called and the numbers should be added.
If the user enters - then the function to subtract the numbers should be called and the numbers should be subtracted.
If the user enters * then the function to multiply the numbers should be called and the numbers should be multiplied.
If the user enters / then the function to divide the numbers should be called and the numbers should be divided(quotient will be calculated).
Q3)Taking the (in-module-example of the car, create a new Bike Class and include one or more additional variables for the speed of the bike. Include mutator and accessor methods for the bike’s speed and use them in the start(), accelerate(), brake() and stop() methods to extend their functionality. When the bike starts, initialise its speed to 0. Allow the accelerator method to increase the speed by an increment and the brake method to decrement the speed. Print the current speed to the screen
Race time:take the same example and separate the class into a header file. Write another program that instantiates two bike objects,both of different models (if you don’t know bikes, look up examples for brands of bikes). In your code, start each bike and then accelerate each bike at different rates. Do this in a loop for each bike and then reverse the rates for braking till one bike comes to a complete stop. Print the name of the bike that comes to a complete stop first and declare the other bike the winner.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Fu
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of