List of variables:
working_hours: Store the working hours for the employees.( Taken as 7 hours)
dependents: Store the number of dependents.
regular_hours: Store the number of regular hours.
Total_income: To store the total income.
List of functions used:
cin(): To take input from input streams like keyboard, files etc.
cout(): To display the output.
Summary Introduction:
Program Description:
The purpose of the program is to find the worker’s gross pay, each withholding amount and the net take-home payfor the week.
Trending nowThis is a popular solution!
Chapter 1 Solutions
Absolute C++
- During the tax season, every Friday, the J & J tax accounting firm provides assistance to people who prepare their own tax returns. Their charges are as follows:a. If a person has low income (<= 25,000) and the Consulting time is less than or equal to 30 minutes, there are no charges; otherwise the service charges are 40% of the regular hourly rate for the time over 30 minutes.b. For others, if the Consulting time is less than or equal to 20 minutes, there are no service charges; otherwise, service charges are 70% of the regular hourly rate for the time over 20 minutes.(For example, suppose that a person who has low income is spent 1 hour and 15 minutes, and the hourly rate is $70.00. Then the billing amount is $70.00 x 40 x (45/60) = $21.00). Write a program that prompts the user to enter the hourly rate, the total Consulting time, and whether the person has a low income. The program should output the building of Mount your program must contain a function that takes as input…arrow_forwardA retail store has a preferred customer plan where customers can earn discounts on all their purchases. The amount of a customer’s discount is determined by the amount of the customer’s cumulative purchases in the store as follows: • When a preferred customer spends $500, he or she gets a 5 percent discount on all future purchases. • When a preferred customer spends $1,000, he or she gets a 6 percent discount on all future purchases. • When a preferred customer spends $1,500, he or she gets a 7 percent discount on all future purchases. • When a preferred customer spends $2,000 or more, he or she gets a 10 percent discount on all future purchases. Design a class named PreferredCustomer, which is derived from the Customer class you created in Programming Problem 4. The PreferredCustomer class should have properties for the amount of the customer’s purchases and the customer’s discount level. Demonstrate the class in a simple application.arrow_forwardFergusonball players are given a star rating based on the number of points that they score and the number of fouls that they commit. Specifically, they are awarded 5 stars for each point scored, and 3 stars are taken away for each foul committed. For every player, the number of points that they score is greater than the number of fouls that they commit. Your job is to determine how many players on a team have a star rating greater than 40. You also need to determine if the team is considered a gold team which means that all the players have a star rating greater than 40. Input Specification The first line of input consists of a positive integer N representing the total number of players on the team. This is followed by a pair of consecutive lines for each player. The first line in a pair is the number of points that the player scored. The second line in a pair is the number of fouls that the player committed. Both the number of points and the number of fouls, are non-negative integers.…arrow_forward
- Question 16arrow_forwardLoyalty points are awarded by a company based on the amount a customer spend. Loyalty points can be used immediately with the current transaction or can be accumulated. The number of loyalty points per transaction is calculated as follows: For purchases of R 500.00 or less, 1 loyalty point will be awarded per R 50.00 spent. For purchases of more than R 500.00 the following applies: For the first R 500.00, 1 loyalty point will be awarded per R 50.00 spent For the remainder of the amount, 2 loyalty points will be awarded per R50.00 spent. Examples: For purchases of R 460.00, 9 loyalty points will be awarded. For purchases of R 660.00, 10 loyalty points will be awarded for the first R 500.00 and 6 loyalty points for the remaining R 160.00 = 16 loyalty points For purchases of R 1250.00, 10 loyalty points will be awarded for the first R 500.00 and 30 loyalty points for the remaining R 750.00 = 40 loyalty points The monetary value of the loyalty points is calculated as follows: The first…arrow_forwardLoyalty points are awarded by a company based on the amount a customer spend. Loyalty points can be used immediately with the current transaction or can be accumulated. The number of loyalty points per transaction is calculated as follows:For purchases of R 500.00 or less, 1 loyalty point will be awarded per R 50.00 spent. For purchases of more than R 500.00 the following applies: For the first R 500.00, 1 loyalty point will be awarded per R 50.00 spent For the remainder of the amount, 2 loyalty points will be awarded per R50.00 spent. Examples:For purchases of R 460.00, 9 loyalty points will be awarded.For purchases of R 660.00, 10 loyalty points will be awarded for the first R500.00 and 6 loyalty points for theremaining R160.00 = 16 loyalty pointsFor purchases of R 1250.00, 10 loyalty points will be awarded for the first R 500.00 and 30 loyalty points for theremaining R 750.00 = 40 loyalty points The monetary value of the loyalty points is calculated as follows: The first 30…arrow_forward
- In the US Higher Education sector, a degree is classified using a Grade Point Average (GPA). The grades ‘A’, ‘B’, ‘C’, ‘D’ or ‘F’ are called academic grades. Each ‘A’ is worth 4 points, each ‘B’ is worth 3 points, each ‘C’ is worth 2 points, each ‘D’ is worth 1 point and each ‘F’ is worth 0 points. The GPA is found by calculating the number of points and then dividing by the number of academic grades. A student may also have a non-academic grade of ‘W’ (for withdrew) which is not counted at all in the calculation. You can assume that the student will have at least one academic grade in their list of grades. There are many ways of calculating a GPA from a list of grades, but you must follow the algorithm given by this top-level decomposition: > Find GPA. >> Input a list of academic and non-academic grades. >> Create a new list that consists of the number of points for each academic grade in the input list. >> Add up the values in the new list and divide by the…arrow_forwardWrite collection of production rules to calculate electricity bill as per following rules: •If the units consumed are less than and equal to 300, then the cost is Rs 10/- per unit. •If the units consumed are more than 300 and less than and equal to 500, then the cost is Rs 12/- per unit. •If the units consumed are more than 500 and less than 1000, then the cost is Rs 15/- per unit and surcharge of 15% of bill is added. •If the units consumed are more than 1000, then the cost is Rs 15/- per unit and surcharge of 25% of bill is added. Trace the production rules for the sample execution of the system given below;Write collection of production rules to calculate electricity bill as per following rules: •If the units consumed are less than and equal to 300, then the cost is Rs 10/- per unit. •If the units consumed are more than 300 and less than and equal to 500, then the cost is Rs 12/- per unit. •If the units consumed are more than 500 and less than 1000, then the cost is Rs 15/- per unit…arrow_forwardYour English professor has announced the following grading policy: For each essay, the highest score in the class will be entered as a 100%; all other scores will be entered as the percent of that top score. For example, if the highest essay is a 50 out of 100, it will be counted as a perfect paper, and essays with a score of 40 out of 100 will be entered as an 80%. The final grade for the course will be determined using these adjusted percentages, with 90% and above an A, 80% and above a B, 70% and above a C and below 70% not passing. The students all get together and decide not to work hard on the next paper because if nobody does well, they will all do okay. This plan results in a Nash Equilibrium. A.) is a solid commitment device, and thus stable. B.) will be unstable because there is an incentive to break the agreement. C.) will be stable because there are no incentives to deviate. D.) requires everyone to follow their…arrow_forward
- You can graduate only if you have completed the requirements of your major and you do not owe money to the university and you do not have an overdue library book. Express your answer in terms of g: “You can graduate,” m: “You owe money to the university,” r: “You have completed the requirements of your major,” and b: “You have an overdue library book.”arrow_forwardThe calculation of the bill will be used the following rules: -The bill will be exempted for usage 20m3 and below.-For the next 15m3 is charged at 50cents/m3.-The next 20m3 is charged at 70cents for every additional m3.-The next 25m3 is charged at $1.00 for every additional m3.-Any further m3 is charged at $1.20 for every additional m3.In this case, the input can be up to 200 m3. The system only accepts the numeric(non-negative) values as the input. Other than the accepted value will be rejected by the system with an error message. The output of the system will be the total bill charged. write out equivalence partition (EP) for the above specification.arrow_forwardShow your work!arrow_forward
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks ColeC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage