Page 57 - C++
P. 57
Schedule();
void Start();
void View();
};
void main()
{
Schedule S; //Statement 1
___________ //Statement 2
}
(i) Write the names of all the member functions, which are directly accessible
by the object S of class Schedule as declared in main() function.
(ii) Write the names of all the members, which are directly accessible by the
memberfunction Start( ) of class Schedule.
(iii) Write Statement 2 to call function View( ) of class Programme from the
object S of class Schedule.
(iv) What will be the order of execution of the constructors, when the object S
of class Schedule is declared inside main()?
OR
(d) Consider the following class State :
class State
{
protected :
int tp;
public :
State( ) { tp=0;}
void inctp( ) { tp++;};
int gettp(); { return tp; }
};
Write a code in C++ to publically derive another class ‘District’
with the following additional members derived in the public
visibility mode.
Data Members :
Dname string
Distance float
Population long int
Member functions :
DINPUT( ) : To enter Dname, Distance and population
DOUTPUT( ) : To display the data members on the screen.
5