Navin k
2009-05-08 07:52:36 UTC
class objects and add 1 object OM with another object of DB. .
Use a friend function to carry out the addition operation the object that stores the results
may be a DM object or a DB object, depending upon the units in which the results are
require. The display should be in the format of feet and inches or meters and cms
depending on the object on display
QUES 2. A book shop maintains the inventory of books that are being sold at the shop the list includes details such as author, title and publisher and stock position. Whenever a customer wants the book, the sales person inputs the title and author and the system
search the list and display whether it is available ornot. If it is not, a appropriate message is displayed, if it is, then the system displays the book details and requests for the number of copies require. If the requested are available, the total cost of the required copies is displayed: otherwise the message" Required copies not in stock"is displayed. Design a system using a class called books with suitable member functions and constructors. Use new operator in constructor to allocate memory space require.
QUES 3. Define a class string that could work as a userdefined string type include constructors that will enable us to create an .un-initialized string
String s1; :/ string with length 0
And also to initialize an object with string constant at the time of creation like
String s2("well done"); .
Include a function that adds two strings to make a third string.
QUES 4. Create a base class called shape use this class to store two double type values that could be used to compute the area of fig. Derive the specific class called TRIANGLE and RECTANGLE from the data shape. Add to base class, a member function get - data ( ) to initialize base class data members and another member and another member function
display – area( ) to compute and display the area of the fig.. Make display – area ( ) as a
virtual function and redefine function in the derived classes to suit their requirements,
Using these 3 classes design a program that will accept dimension of RECTANGLE or
TRIANGLE interactivity and display the area.
Remember the 2 values given as input will be treated as length of 2 sides in the case of
rectangle and as base and height in the case of triangles and used as follows:
Area of rectangle = x*y
Area of triangle = 1/2 *x*y
QUES 5. WRITE AN INTERACTIVE OPERATOR OVERLOAD PROGRAM TO MANIPULATE MATRICES.OVERLOAD OPERATORS SUCH AS <<,>> AND + FOR OPERATIONS ON A SINGLE DIMENSION ARRAY.
QUES 6. Assume that a bank maintains two kinds of accounts for customers, one called savings account and the other as current account. The savings 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 and if the 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 derive the class CUR_ACCT and SAV_ACCT to make them more specific to their requirements.WRITE A FUNCTION TO DEPOSIT, WITHDRAW AND QUERY BALANCES.
QUES 7. write a program to manipulate N student objects.overload a subscript operator for bounds check while accessing ith student object when i>=N.
ques 8. design a single link list class having functionality to add nodes,traverse and print nodes.write a program to perform these task.
ques 9. WRITE A PROG TO COMPUTERIZE THE UNIVERSITY LIBRARY.THE LIBRARY HAS TWO TYPES OF MEMBERS:STUDENT,STAFF.THE STUDENT CAN BORROW 3 BOOKS AND THE STAFF CAN TAKE 10 BOOKS ONLY.THE DUE DATE IS 7 DAYS AND 30 DAYS FOR STAFF.IF THE BOOKS IS NOT RETURNED BY DUE DATE FINE IS PUT FOR EACH DAY.STAFF HAS NO FINE.
DESIGN COMPLETE PROG USING INHERITANCE, VIRTUAL FUNCTION,ABSTRACT CLASSES.WRITE A FUNCTION TO WITHDRAW BOOKS FROM LIBRARY.
QUES 10. WRITE A PROGRAM TO OVERLOAD 'NEW' AND 'DELETE' OPERATORS SO THAT THE MEMORY RESOURCES ARE HANDLED IN BETTER WAY.
QUES 11. WRITE A PROG TO OVERLOAD THE RELATIONAL OPERATOR <,>,== AND != TO WORK ON STRING TYPE OF OBJECT.
QUES 12. WRITE A PRO USING CLASSES TO CREATE A SINGLE LINK LIST.THE SHOULD HAVE CAPABILITY TO ADD, DELETE AND PRINT THE NODES.
QUES 13. WRITE A PROGRAM USING CLASS TEMPLATE TO SEARCH AN ELEMENT IN AN ARRAY USING BINARY SEARCH METHOD.ASSUME THAT THE ARRAY IS ALREADY SORTED.
QUES 14. CONSIDER AN EXAMPLE OF DECLEARING THE EXAMINATION RESULT.DESIGN 3 CLASS: STUDENT,EXAM AND RESULT.THE STUDENT CLASS HAS DATA MEMBERS OF STUDENT INFORMATION.CREATE A CLASS EXAM BY INHERITING STUDENT CLASS.DERIVE THE RESULT CLASS FROM EXAM CLASS AND ADD YOUR OWN DATA AND