Based on the inheritance hierarchy/tree, write a C++ program to get the width, length and
height from users and call the calculateArea() member function of the Calculate
drived class to determine and return the volume of the user’s input. Before the program
ends, display all values read from users and the calculated area.
2. Make a C++ program that will calculate the total expenses and Cash left of Miss Carla after spending the following :
Cash - 4,050.00
B&W perfume - 700.50
B&W lotion - 560.85
Dresses - 2072.50
Note : the program must display the cash left and total expenses.
1. Create a C++ program that let the user input his/here grade on the following subjects: Programming, Web Application, Oral Communication, Multimedia and Physics and calculate the average.
Note : the program must also display/output the subjects with grades from the user and the average.
Write a program that prompts the user to input an integer and then outputs both
the individual digits of the number and the sum of the digits.
write a program to find the table of numbers using a while loop. your program should ask about the size of the table. the size defines the rows and columns. sample output
Enter size : 6
1 2 3 4 5 6
----------------------------------
1* 1 2 3 4 5 6
2* 2 4 6 8 10 12
3* 3 6 9 12 15 18
4* 4 8 12 16 20 24
5* 5 10 15 20 25 30
6* 6 12 18 24 30 36
Explain how overloading a unary operator is almost similar to overloading a binary operator with necessary examples and include main() function to demonstrate. Mention the differences between these two in terms of number of operands they deal with.
Create a function to print out all the data for the Student. Remember to prototype this function and use outside of a class function.
1. Write a C++ program that prompts the user for the fuel quantity and the fuel price
per litr
Task:1
A single point has two coordinates p1(x,y). Create a class name Point with a length 2 array asit's private data member. Initialize the array using constructor. Overload array subscript operator ‘[ ]’ for if I have to access the object's array at a particular index from main function
like this.
Point p1(1, 1);
cout << p1[0] << " " << p1[1] << endl;
Task#02:
Copy paste the same task and do consider doing it in dynamic memory instead of static. Plus alter the subscript overloaded function for if I have to make changes to the class array from the main function. Hint: By reference
Point p2(3, 3);
cout << p2[0] << " " << p2[1] << endl;
p2[0] = 7;
p2[1] = 9;
cout << p2[0] << " " << p2[1] << endl;
Write a Program: Competition Score
Your goal is to create a program that will determine the average score for an
athlete in a competition. There are 10 judges who each award a score between 0 and 10. The lowest and highest scores are thrown out, and the athlete’s score is the average of the eight remaining scores. The scorecard should have the first and the last name of the athlete on the first line and 10 space-separated numbers between 0 and 10 on the second line. The numbers should have at most 1 digit after the decimal point.
Example Input File:
Mirabella Jones
7.5 8.8 7 8.1 8 9.8 9.3 8.9
Example Output:
First run
ERROR: the scorecard could not be opened
Second run
Insufficient scores
Mirabella Jones is disqualified
Third run
Invalid scores
Mirabella Jones is disqualified
Fourth run
Mirabella Jones's results:
7.5, 8.8, 7.0, 8.1, 8.0, 9.8, 9.3, 8.9
The highest score of 9.8 and the lowest score of 7.0 were dropped
The average score is 8.59