Write a definition of class named Race. It has following private data member
carNo (int)
driverID (int)
carModel (int)
The class has one constructor Race (int, int, int) that initializes the values of carNo,
driverID and carModel. Race class has following member functions
void InputValues( ) // this will be used to input values of data member of Book
object from user
void setValues(int cn, int di, int cm); // it will assign values of cn, di and cm to
carNo, driverID and carModel respectively
void display( ); // it displays the value of private
Create two object of Rave class. Assign values using InputValues and setValues function and display them using display function.
Comments
Leave a comment