0% found this document useful (0 votes)
47 views

Assignment C++ Problems

a collection of problems in c++
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Assignment C++ Problems

a collection of problems in c++
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Object Oriented Programming through C++

Lab Assignment
1. Design a class TIME which stores hour, minute and second. The class
should have the methods to support the following:
User may give the time value in !"hour format.
User may give the time value in #M$%M format
Display the time in !"hour format.
Display the time in #M$%M format.
User may li&e to add minute with a time value.
. Design a T'((T#) class to store the num*er of cars that crossed the
*ridge and total amount collected. It must support the following
activities.
+eceiving toll.
Display num*er of cars that crossed the *ridge.
Display the amount of toll collected.
,. -reate a .T#-/ class with operation for initiali0ation, push and pop.
.upport for chec&ing underflow and overflow condition are also to *e
provided.
!. -reate a class for lin&ed list. -onsider a separate class 1'DE for
*asic node activities and use it in class for lin&ed list.
2. Design a class for the following scenario:
#n item list contains item code, name, rate, and 3uantity for
several items.
4henever a new item is added in the list uni3ueness of item
code is to *e chec&ed.
Time to time rate of the items may change.
4henever an item is issued or received e5istence of the item is
chec&ed and 3uantity is updated.
In case of issue, availa*ility of 3uantity is also to *e chec&ed.
User may also li&e to &now price$3uantity availa*le for an item.
6. Design a .TUDE1T class to store roll, name, course, admission date
and mar&s in 2 su*7ects. %rovide methods corresponding to admission
date and receiving mar&s, preparing mar& sheet. .upport must *e there
to show the num*er of students who have ta&en admission.

8. Design a 9#(#1-E class with account num*er, *alance and date of
last updation. -onsider a T+#1.#-TI'1 class with account
num*er, date of transaction, amount and transaction type. If it is a
withdrawal chec& whether the amount is availa*le or not. Transaction
o*7ect will ma&e necessary updation in the 9#(#1-E class.
:. Design a -'M%(E) class, which will *ehave li&e normal integer
with respect to
addition,
su*traction,
accepting the value and
displaying the value.
;. Design an #++#< class with the following features:
a. #rray o*7ect may *e declared for a specific si0e and a value for
initiali0ing all the elements. If this it is to *e assumed as a =.
*. #n array o*7ect may *e declared and initiali0ed with another
o*7ect.
c. #n array o*7ect may *e declared and initiali0ed with another
array >not the o*7ect, standard array as in - language?.
(et a and * are two o*7ects:
i. a@* will add corresponding elements.
ii. aA* will do the assignment.
iii. aBIC will return the ith element of the o*7ect.
iv. aD2 or 2Da will multiply the element with 2.
1=.Design a .T+I1E class, which will have the initiali0ation facility
similar to array class. %rovide support for
#ssigning one o*7ect for another,
Two string can *e concatenated using @ operator,
Two strings can *e compared using the relational operators.
11. Modify the .T+I1E class so that assigning$initiali0ing a string *y
another will not copy it physically *ut will &eep a reference count,
which will *e incremented. +eference value = means the space can *e
released.
1.In a li*rary, *oo&s, and 7ournals are &ept. Fournals are issued to faculty
mem*ers only. # student mem*er can have *oo&s issued at a time.
Gor faculty mem*ers it is 1=. Gor late return student mem*ers are
charged +s. 1 per day. Gaculties are not charge. Gor 7ournals
additional information li&e issue no., date of pu*lish, volume no., etc.,
are to *e stored. Gor any transaction, mem*ers are supposed to place
transactions slip. #fter necessary validations, transaction is carried
out. Each transaction is to *e noted into a register. Implement the
system descri*ed a*ove after designing the necessary classes.
1,.In a *an& two types of accounts are there savings and current. Gor
savings account a minimum deposit of +s. 2== are to *e &ept. In
current account overdraft upto +s. =,=== is allowed. Each transaction
is noted. Design and implement the necessary classes.

You might also like