Skip to content

Commit a2612ed

Browse files
committed
OOP2 Lab6 updated
1 parent ee1be7b commit a2612ed

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

OOP2_Lab6/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Practical Lab Assignment - Inheritance
2+
3+
### Program 1
4+
Imagine a publishing company that markets both book and audio cassette version of its works. Create a class Publication that stores the `title` (a string) and `price` (type float) of a publication.
5+
6+
From this class derive two classes:
7+
- `Book`, which adds a page count (type int).
8+
- `Tape`, which add playing time in minutes (type float).
9+
10+
Each of these three classes should have:
11+
- `getdata() function to display its data
12+
- `setdata()` function to get its data from the user at the keyboard.
13+
14+
Write a main() program to test the Book and Tape classes by creating instances of them, asking the user to fill with data with `setdata()`, and then displaying the data with `getdata()`.
15+
16+
### Program 2
17+
Assume that a bank maintains two kinds of accounts for customers, one called as saving and the other called as current account.
18+
19+
The saving account provides interest and withdrawal facilities but no cheque book facility.
20+
21+
The current account provides cheque book facility but no interest. Current account holders should also maintain a minimum balance and if the balance falls below this level a service charge is imposed.
22+
23+
Create a class `ACCOUNT` that stores customer name, account number and type of account.
24+
25+
From this derive the classes `CURR_ACCT` and `SAV_ACCT` to make them more specific to their requirements.
26+
27+
Do not use any constructors. Use member functions to initialize the class members. Include necessary member functions in order to achieve all the tasks:
28+
29+
Design a menu based program where user selects the type of account and perform the following tasks:
30+
- Accept deposit from a customer and update the balance.
31+
- Display the balance.
32+
- Compute and deposit interest.
33+
- Permit withdrawal and update the balance.
34+
- Check for the minimum balance, impose penalty, necessary and upload the balance.
35+
36+
```
37+
CURR_ACCT:
38+
---
39+
amount, penalty
40+
---
41+
Deposit() – will deposit the money and update amount
42+
Balance() - will display the balance of account
43+
Withdraw() – will allow to withdraw from account (check if withdrawal amount is less than balance and update balance)
44+
Penalty() – apply penalty of USD 2 for maintaining balance less than 100 USD
45+
```
46+
```
47+
SAV_ACCT:
48+
---
49+
amount
50+
---
51+
Deposit() – will deposit the money and update amount
52+
Balance() - will display the balance of account
53+
Compute_Interest() – calculate interest based on given condition [ROI is 4% per annum]
54+
Withdraw() – will allow to withdraw from account (check if withdrawal amount is less than balance and update balance)
55+
```
-17.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)