Cse2001 Object-Oriented-programming-with-c++ LTP 1.0 1 Cse2001
Cse2001 Object-Oriented-programming-with-c++ LTP 1.0 1 Cse2001
CSE2001 Type
4
LTP
Course Objectives:
3 Assume that a bank maintains two kinds of account for its customers, one l
called saving account and the other current account. The saving account
provides compound interest and withdrawal facilities but no cheque book
facility. The current account provides cheque book facility but no interest.
Current account holders should also maintain a minimum balance falls
below this level, a service charge is imposed.
Create a class Account that stores customer name, account number, and
type of account. From this device the classes Curr-acct and Sav-acct to
make them more specific to their requirements. Include the necessary
methods in order to achieve the following tasks.
Accept deposit from a customer and update the balance
Display the balance
Compute and deposit interest
Permit withdrawal and update the balance
Check for the minimum balance, impose penalty, if necessary and
update the balance.
Do not use any constructors. Use methods to initialize the class members.
4 An election is contested by 5 candidates. The candidates are numbered 1 l
to 5 and the voting is done by marking the candidate number on the ballot
paper. Write a C++ program to read the ballots and count the votes cast
for each candidate using an array. In case, a number read is outside the
range 1 to 5, the ballot should be considered as a ‘spoilt ballot’ and the
program should also count the number of spoilt ballots.
5 Develop a program which will read a string and rewrite it in the l
alphabetical order. For example, the word STRING should be written as
GINRST
6 Create a class by name date with the member data day, month and year. l
Perform the following:
Overload all relational operators <,<=,>,>=,==,!=
Overload ++ operator to increment a date by one day
Overload + to add given number of days to find the next date
Provide the necessary function to use the statement like days=dt;
where days is an int variable and dt is an object of date class. The
statement is intended to assign the number of days elapsed in the
current year of the date to the variable days. Note that this is a case
of conversion from derived type to basic type.
7 Develop a program to sort a file consisting of books’ details in the l
alphabetical order of author names.
The details of books include book_id, author_name, price,
no_of_pages, publisher, year_of_publishing
8 Design a class template by name Vector and perform the following: l
Find the smallest of the element in the Vector
Search for an element in the Vector
Find the average of the element in the array
9 Design a generic function for finding the largest of three numbers. l