class and object assignment
class and object assignment
[Set – 1]
[Set – 1]
1. Define a class student with the following specification
admno integer
sname 20 character
total float
Takedata() Function to accept values for admno, sname, eng, science and
invoke ctotal() to calculate total.
Private members:
bname 20 characters
batavg =runs/(innings-notout)
Public members:
Private Members
(NoCandidates/100+1)
Public Members
- A function DISPTEST() to allow user to view the content of all the data members
solution
Private Members
A member function CALFUEL() to calculate the value of Fuel as per the following
criteria
Distance Fuel
<=1000 500
Public Members
A function FEEDINFO() to allow user to enter values for Flight Number, Destination,
Distance & call function CALFUEL() to calculate the quantity of Fuel
A function SHOWINFO() to allow user to view the content of all the data members
solution
BOOKTITLE 20 characters
Note : You are also required to give detailed function definitions. solution
Private members :
adno 4 digit admission number
name 20 characters
Public members:
READINFO() function to accept values for adno, name, marks. Invoke the
function GETAVG()