Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
Ass 06

Ass 06

Ratings: (0)|Views: 224 |Likes:
Published by gaurav31101987

More info:

Published by: gaurav31101987 on Sep 25, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

11/26/2012

pdf

text

original

 
S
INHGAD
I
NSTITUTE
 
OF
B
USINESS
A
DMINISTRATION
 
AND
R
ESEARCH
 
Class:
MCA – Sem III
Subject:
C++
Date: 02/08/10Assignment: 6 Submission Date:11/08/10
1.Create a base class
math_operations
, which accepts numbers from user. Derivetwo classes,
Add
and
Multiply
from it to perform the corresponding operations.2.Design a hierarchy o
toys
. The base class is a
toy
. Derived classes are
stuffedtoy
,
battery power toy
and
mechanical toy
. Write a program to demonstratesingle inheritance.3.Write a C++ program to implement multilevel inheritance. Use a base class
Student
, intermediate base class as
test
and Derived base class as
Result
.4.Create class
employee
with data members emp_no, emp_name, and basic_sal.Derive a class
officer
from employee who gets additional traveling allowance(10% of basic). Derive a class
manager
from officer who gets a special childreneducational allowance (Rs. 5000/-). Write the necessary member functions toaccept and display details. Write a function in each class which displays the totalsalary.5.Write a base class
student(
roll_no,name). Derive two classes
Science(
maths, phy,comp) and
Commerce
(acc, stats) from it. Accept details of students, they could be from science or commerce. Display the details of all students in same order of acceptance.6.Imagine a publishing company that markets both book and audio cassette versionsof its works. Create a class publication that stores the title and price of a publication. From this class derive two classes
book 
, which adds a pagecount and
tape
, which adds a playing time in minutes. Each of these three classes shouldhave getdata () functions to get its data from the user and putdata () to display itsdata. Write a main () program to test book and tape classes by creating instancesof them asking the user to fill in their data with getdata () and then displaying thedata with putdata ().7.Create a base class called
shape
. Use this class to store
double
type values thatcould be used to compute the area of figures. Derive two specific classes called
triangle
and
rectangle
from the base
shape
. Add to the base class, a member function get_data( ) to initialize base class data members and another member function disp_area( ) to compute and display area of figures. Make disp_area( ) asa virtual function and redefine it in the derived classes to suit their requirements.8.Write
string
class as a base class, derive a class
pstring
i.e. protected string that prevents buffer overflow when too long string constant is used in a definition. A
 
new constructor in the derived class should copy only size – 1 characters into str if the string constant is longer, but copy the entire constant if it is shorter. Write amain program to test different lengths of strings.9.Consider the class network of figure mentioned below. The class
master
derivesinformation from both
account
and
admin
classes, which in turn deriveinformation from the class
person
. Define all the four classes and write a programto create, update, and display the information contained in
master
objects.10.Assume that a bank maintains two kinds of accounts for customers, one called assaving account and the other as current account. The saving account providescompound interest and withdrawal facilities but no cheque book facility. Thecurrent account provides cheque book facility but no interest. Current accountholders should also maintain a minimum balance and if the balance falls belowthis level, a service charge is imposed.Create a class account that stores customer name, account number andtype of account. From this derive the classes
cur_acct
and
sav_acct
to make themmore specific to their requirements. Include necessary member functions in order to achieve the following tasks.a.Accept deposit from a customer and update the balance. b.Display the balance.c.Compute and deposit interest.d.Permit withdrawal and update the balance.e.Check for the minimum balance, impose penalty, inecessary, and update the balance.Do not use any constructor. Use member functions to initialize the class members.11 Develop an object oriented program in c++ to create a library information systemcontaining the following for all books in library:
Accession number  personnamecodeaccount payadminexperiencemaster namecodeexperience pay

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->