You are on page 1of 1

FALL Semester 2021-2022

Lab Cycle Sheet 4


Programme Name & Branch: B.C.A. Slot: L49+L50
Course Code: ITA3001 Course Title: Object Oriented Programming
Date : Nov 28, 2021 Time : 1 pm

NOTE: VTOP will not be working from Nov 28,2021 at 6 pm till Nov 30,2021.
So try uploading the Lab Cycle Sheet 4 as per the deadline given for smoother
process.

1. Write a base class called trainreservation that describes an operation as


either book ticket or cancel ticket. Define two derived classes called booking
and cancellation that define operation specific items. Write pure virtual
functions in the base class for operations that are common to both operations
yet are handled in different ways by each of them?

2. Write a "checkbook" class. You put a list of numbers into this class and get
a total out.
Member functions:
void check::add_item(int amount); // Add a new entry to the checkbook
int check::total(void); // Return the total of all items
Update the checkbook class so that it generates an exception when your
balance goes below zero.

You might also like