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

C++ full program that calculate the value of U. U=a+g*power(v,2) where g=constant

Implement following class hierarchy using multi level inheritance.



School




Department




Teacher




Data member's are as follows: School: School Name, Number of department Department: Department Name, Number of employee Teacher: Teacher Name, salary of the teacher.

Using Switch statement, write a program that displays the following menu for the bank operations available to take services from the customer: 

D= Deposit, W= Withdraw T= Transfer

The program inputs the type of service and amount. It finally displays the amount to be transfer/deposit/transfer after applying charges, total remaining balance of customer according to the following criteria:

Deposit = 0.5% charges of deposited amount

Withdraw = 1.5% charges of withdraw amount

Transfer = 2.5% charges of transfer amount


Write the class definition for a Car class. Provide the following data members:



 A C-string called make of size 20 to store the car manufactures name, e.g. Ford, Toyota,



….;



 In integer called year to hold the year of first registration of the vehicle;



 A floating point called km to contain the number of kilometers traveled for the trip;



 A floating point called liter to contain the liters used to cover the distance;



 A floating point called consumption is the calculated value of liter per km.



 Class-wide floating point called expense, for the cost per kilometer, which should be



initialized to R7.55.



The class also contains the following methods:



 A default constructor that will set the data members to appropriate default values if



nothing is sent to it, and set them to the values sent as parameters if parameters are



received.




c++ program to find the factorial of any number between 3 and 9

Write the following non-member functions:



 readFile that receives an array of Cars and the maximum number of cars that can be



read into the array, and will read the car information stored in Question 1 in file car.txt



and set the objects in the Car array to these values. Ensure that you do not go past the



boundary of the array. This function will return the updated Car array and the number



of cars that were entered.

Design a program that generates the general average of four grading systems (Prelim, Midterm, Prefinals and Finals). Display the remarks and Equivalent Grade as output based on the following given scale. *

(Pure Virtual Function) Write the above program by modifying by making display() as pure virtual function.


Q1:Define a class ABC. Derive two classes BBC and KBC from ABC. All the classes contains same member function name as display(). The base class pointer always holds the derived class objects.

a) Write a program such that base class pointer or reference will always access/call the base version of the members available in derived class, do not have any access to the derived class members.

b) Write a program such that base class pointer or reference will always access/call the derived version of the members available in derived class, do not have any access to the base class members.

Write down the concepts used for bit a) and b) separately.


make a program that will compute and display the total amount of a purchased product


LATEST TUTORIALS
APPROVED BY CLIENTS