Assignment - Classes AND Objects XII CS
Q1. Differentiate between public & private visibility modes in context of Object Oriented Programming using suitable examples. Q2. What do you understand by a member function? How does a member function differ from an ordinary function? Q3. What are the advantages and disadvantages of inline functions. Q4. What are static class members? Q5. Rewrite following code after removing syntax errors.UNderline each correction. class TRAIN{ long TrainNo; Char Description[25]; public: void Entery(){ cin>>TrainNo; gets(DEscription); } void Display(){ cout<<TrainNo<<":"<<Description<<endl; } }; void main(){ TRAIN T; Entry.T(); DIsplay.T(); } Q6. Define a class Flight 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 float A Member Function CalFuel( ) to ...