Create a 'DISTANCE' class with the following members:
Data Members
b) feet and inches
Member Functions
d) To input distance through constructor
e) To output distance
f) To add two distance objects
Write a main function to create objects of DISTANCE class. Input two distances (one through
implicit call and other explicit call and output the sum.
Write a program to perform addition of two complex numbers using constructor overloading.
The first constructor which takes no argument is used to create objects which are not initialized, second which takes one argument is used to initialize real and imaginary parts to equal values and third which takes two argument is used to initialize real and imaginary to two different values.
Write a program to perform addition of two complex numbers using constructor. Complex numbers are given through user input.
Create a class which stores name, roll number and total marks for a student.Input the data for a student and display it.
Consider an array MARKS[20][5] which stores the marks obtained by 20 students in 5 subjects. Now write a program to
(a) find the average marks obtained in each subject.
(b) find the average marks obtained by every student.
(c) find the number of students who have scored below 50 in their average.
(d) display the scores obtained by every student.
WAP to create the classes as per the hierarchy shown below.Include the data members in the relevant classes to store the following information:-
Name, Id, No of matches played,No. of runs scored, No. of wickets taken.
Calculate the batting average and wickets per match for an all rounder player.Use parameterized constructor to initialize the object.
[ Batting average=No. of runs scored/No. of matches played
Wickets per match= No. Of wickets taken/ No. of matches played ]
WAP to Create a class ‘Book’. Derive two classes from it namely ‘’Print_Book’ and ‘E_Book’. Store the following details about the book in the relevant classes. Title, Author, Price, No of pages and Size in KB. Input information for ‘m’ number of print books and ‘n’ number of eBooks and display it.
WAP to create a class which stores a dynamic integer array and its size. Include all the constructors and destructor in the class. Store two arrays of different size in two objects. Join the two arrays and and store it in another object using a member function.