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

Assignment Classes

Ratings: (0)|Views: 57 |Likes:
Published by chandni1972

More info:

Published by: chandni1972 on Apr 18, 2010
Copyright:Attribution Non-commercial


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





Maharaja Agrasen model School, Pitam Pura,Delhi.Revision Assignment – Classes And Objects
Define a class
in C++ with the following specification:Private Members:
A Data Member Flight Number of type integer 
A Data Member Destination of type String
A Data Member Distance of Float Type
A Data Member Fuel of type floatA Member Function CalFuel( ) to calculate the value of fuel as per the following criteria:Distance Fuel<=1000 500more than 1000 and <=2000 1100more than 2000 2200
Public Members:
A function Feed_Info( ) to allow user to enter values for Flight Number, Destination,Distance & Call Function CalFuel( ) to calculate the quantity of fuel.A Function Show_Fuel( ) to allow user to view the content of all the data members.
Define a class
with the following specification:Private membersTestcode of type integer Description of type string NoCandidate of type integer A member function
to calculate and return the number of centers as ( NoCandidate / 100 + 1)Public membersA constructor function to initialize Testcode as 12.A function IN_DATA( ) to accept values for Testcode, Description, NoCandidateAnd call function CALCNTR( ).A function OUT_DATA( ) to display all the data members.3. Define a class REPORT with the following specificationPrivate:Adno 4 digit admission number  Name 20 charactersMarks an array of floating point valuesAverge average marks obtainedGetavg( ) to compute the average obtained in five subjectsPublic:Readinfo( ) function to accept values for adno, name, marks andInvoke the function Getavg( )Displayinfo( ) function to display all data members on the screen.4.Define a class in C++ with the following description :
A data member 
of type integer.
A data member 
of type string
A data member 
of type float
A data member 
of type floatA member function
to calculate the value of Fuel as per the following criteria :
Distance Fuel
<=1500 250more than 1500 and <=3000 1000more than 3000 2500

You're Reading a Free Preview

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