Questions: 11 448

Answers by our Experts: 10 707

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 & Filtering

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 


In this question, you are required to write C++ code that checks whether the number

entered by the user is a happy number or not for 10 cycles/iterations only.

Example: Assume a number 19

Number Computation Result cycle/iterations

19 1

2 + 9

2 82 1


82 8

2 + 2

2 68 2


68 6

2 + 8

2 100 3


100 1

2 + 0

2 +0

2 1 4




How to convert basic data to user defined data type?


There is a secret organization and they



want to create a secret language for the



calculation to make the data secure.



Now the manager of the organization



asked his IT employee to make the



program which will function as follows:



a) * will subtract the numbers b) - will



divide the numbers c) / will add the



numbers d) + will multiply the numbers.



Use operator overloading.

Write a program that calculates the take-home pay for an employee. The two types of employees are salaried and hourly. Allow the user to input the employee first and last name, id, and type. If an employee is salaried, allow the user to input the salary amount. If an employee is hourly, allow the user to input the hourly rate and the number of hours clocked for the week. For hourly employees, overtime is paid for hours over 40 at a rate of 1.5 of the base rate. For all employees’ take home pay, federal tax of 18% is deducted. A retirement contribution of 10% and a Social Security tax rate of 6% should also be deducted. Use appropriate constants. Design an object-oriented solution. Create a second class to test your design.



A college offers a course that prepares students for the state licensing exam for real estate brokers. Last year, ten of the students who completed this course took the exam. The college wants to know how well its students did on the exam. You have been asked to write a program to summarize the results. You have been given a list of these 10 students. Next to each name is written a 1 if the student passed the exam or a 2 if the student failed. Your program should analyze the results of the exam as follows: Input each test result (i.e., a 1 or a 2). Display the prompting message "Enter result" each time the program requests another test result. Count the number of test results of each type. Display a summary of the test results indicating the number of students who passed and the number who failed. If more than eight students passed the exam, print the message "Raise tuition."


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS