Wednesday, 20 August 2014

Assignment code-CS3L02

1. use the concept of function overloading to find out volume of a cuboid, volume of a cylinder and volume of a rectangular box.

2. define a class called item having data members rate and quantity.
use appropriate member functions to initialise the values and to display the total cost.

3. define a class called bank having data members account, name, balance. use appropriate member functions to initialise the values, deposit certain amount, withdraw certain amount and display name and balance
4.
Define a class BOOK with the following specifications :
Private members of the class BOOK are
BOOK NO                integer type
BOOKTITLE             20 characters
PRICE                     float (price per copy)
TOTAL_COST()        A function to calculate the total cost for N number of copies where N is passed to the                               function as argument.
Public members of the class BOOK are
INPUT()                   function to read BOOK_NO. BOOKTITLE, PRICE
PURCHASE()            function to ask the user to input the number of copies to be purchased. It invokes                               TOTAL_COST() and prints the total cost to be paid by the user. 
Test using main function.

5. Create a class called Triangle with private members s1, s2, s3. Use appropriate member functions to calculate the area of the triangle if possible.

No comments:

Post a Comment

C Programming

  Table of Contents ​ About the Author 3 ​ Introduction 4 ​ Introduction to Computers 4 1. What is a Computer? 4 2. History...