Define a class Pairs with 2 integer data members, f & s, where f represents
the 1st value in the ordered pair and s represents the 2nd value. Objects of type Pairs can be used wherever ordered pairs are
needed.
The class must have a default constructor that initializes data members to
0, & 2overloaded constructors, 1 with one int parameter and the other with
2 int parameters. The 1-parameter constructor should initialise the 1st
member of the pair; the 2nd member of the pair must be 0. The 2-parameter
constructor must initialise both members of the ordered pair.
The class must have a destructor that outputs 'Bye'
Add accessor functions that return the values stored in each of the member
variables of an object of class Pairs & mutator functions to update each of the member variables of an object of class Pairs
respectively. The class must contain a void member
function reset() that resets the member variables of a Pairs to values
specified by parameters.
Write a program having following classes
Player (Base Class)
Members:
Cricket player (Derived Class)
Members:
Hockey player (Derived Class)
Members:
Football player (Derived Class)
Members:
Write a basic while loop with a function code in the program that sums a stream of integers (input from the keyboard) and continues to do so while the integer entered is not -999. Ask the user to enter values in the range of 1 to 10000 or -999 to quit.
Design four classes: Student, Exam ,Sports and Result. The Student class has data members such as reg. number, name. Create Exam by inheriting the Student. The Exam class adds data members representing the marks scored in 3 subjects. Create Sports by inheriting the Student. The Sports class adds data members representing the marks scored in indoor and outdoor games. Derive the Result from the Exam , Sports and Result has its own data member of Total mark. Write an interactive program with appropriate member functions to model this relationship.