C++ Answers

Questions answered by Experts: 9 913

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Write a program to take input for two integer variables. Assign the value -1 to the variable with higher value using a function.

[Use return by reference ]


Create the classes as per the hierarchy given below. The data members are mentioned along with class name. Include parameterized constructor in all the classes. Input data at run-time for a student, calculate the total marks and percentage and display them.


Student: Name, Roll Number

|

V

Marks: marks in 5 subjects

|

V

Result: total marks, percentage


Create a class employee which stores is name, ID and salary of an employee by user input. The ID should be generated upon the creation of object, starting from 1. Include all the constructors and destructor in the class. Create one object using each of the constructors and display it.


Create a Class triangle with three sides a,b and c as its data members Perform

the following operations: a. Accept the sides of a triangle

b. Display the sides of a triangle

c. Find whether the triangle is an equilateral triangle d. Find whether the triangle is a Scalene triangle

e. Find whether the triangle is an isosceles triangle

The program should have an array of 12 structures to hold weather data for an entire year. When the program runs, it should ask the user to enter data for each month. The program then should display month-wise min., max. and average temperatures and rainfalls in a table-like format. In addition, it should display average min., average max. and average mean temperature of the entire year. Similarly, it should display average min., average max. and average mean rainfall of the entire year. The following checks should be implemented for valid input. • Temperature range: -70 to +60 C • Rainfall range: 1mm to 25mm • Min. value <= Average value <= Max value  



 Write a program that uses the following three structures to store the weather data for a particular month:  



  1. Write a C++ program for the class vehicle and its drive class water transport, road transport and air transport vehicles. Make suitable data variables and member functions. When you create an object must be count and display total no of object created also create every class objects and access member through the member functions.
Write a class marks with three data members to store three marks. Write three member functions, set_marks() to input marks, sum() to calculate and return the sum and avg() to calculate and return average marks.
Write a class marks with three data members to store three marks. Write three
member functions, set_marks() to input marks, sum() to calculate and return the sum
and avg() to calculate and return average marks.

Write a program to determine the factorial of 4 numbers 

LATEST TUTORIALS
APPROVED BY CLIENTS