In Exercises 39 through 44, write a
Cost of Electricity The cost of the electricity used by a device is given by the formula cost of electricity
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Pearson eText for Introduction to Programming Using Visual Basic -- Instant Access (Pearson+)
Additional Engineering Textbook Solutions
C Programming Language
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Problem Solving with C++ (9th Edition)
Java How To Program (Early Objects)
Concepts Of Programming Languages
Starting out with Visual C# (4th Edition)
- 10. The algorithm shown in Figure 1-13 should calculate and print the gross pay for five workers; however, some of the instructions are missing from the algorithm. Complete the algorithm. If an employee works more than 40 hours, he or she should receive time and one-half for the hours worked over 40. read the employee's name, hours worked, and pay rate calculate gross pay = hours worked times pay rate otherwise, do this: calculate regular pay = pay rate times 40 calculate overtime hours = hours worked minus 40 calculate overtime pay = calculate gross pay = end if print the employee's name and gross pay end repeatarrow_forwardExercise 2 Modify the program that computes wall area to allow the user to enter the price of a gallon of paint. Assume that a gallon of paint covers 350 square feet of a wall. The program outputs the number of gallons needed and the cost of the job. (For this exercise, assume that you do not need to account for windows or doors, and that you can purchase partial gallons of paint.) *Help me solve this question with step-by-step solution. Thank you in advance.arrow_forwardInterest Rates Savings accounts state an interest rate and a compounding period. If theamount deposited is P, the stated interest rate is r, and interest is compounded m timesper year, then the balance in the account after one year is P⋅(1+rm)m. For instance, if$1000 is deposited at 3% interest compounded quarterly (that is, 4 times per year), thenthe balance after one year is1000⋅(1+.034)4=1000⋅1.00754=$1,030.34.Interest rates with different compounding periods cannot be compared directly.The concept of APY (annual percentage yield) must be used to make the comparison. TheAPY for a stated interest rate r compounded m times per year is defined byAPY=(1+rm)m−1.(The APY is the simple interest rate that yields the same amount of interest after oneyear as the compounded annual rate of interest.) Write a program to compare interestrates offered by two different banks and determine the most favorable interest rate. SeeFig. 4.24.arrow_forward
- In the ChiliToGo program in Exercise 12, the costs to produce an adult meal and a child’s meal are $4.35 and $3.10, respectively. Adult meals are sold for $7.00 and children's meals are sold for $4.00. Modify the ChiliToGo program to display the total profit for each type of meal as well as the grand total profit. An example of the program is shown below: Enter number of adult meals ordered >> 10 Enter number of child meals ordered >> 5 10 adult meals were ordered at 7.0 each. Total is 70.0 5 child meals were ordered at 4.0 each. Total is 20.0 Grand total for all meals is 90.0 Profits: Adult profit is 26.5 Child profit is 4.5 Total profit is 31.0arrow_forwardIn the ChiliToGo program in Exercise 12, the costs to produce an adult meal and a child’s meal are $4.35 and $3.10, respectively. Adult meals are sold for $7.00 and children's meals are sold for $4.00. Modify the ChiliToGo program to display the total profit for each type of meal as well as the grand total profit. An example of the program is shown below: Enter number of adult meals ordered >> 10 Enter number of child meals ordered >> 5 10 adult meals were ordered at 7.0 each. Total is 70.0 5 child meals were ordered at 4.0 each. Total is 20.0 Grand total for all meals is 90.0 Profits: Adult profit is 26.5 Child profit is 4.5 Total profit is 31.0arrow_forwardExercise 3 Modify the program that computes paint cost to allow the user to enter the number of doorways that do not have to be painted. Assume that each doorway is 14 square feet. Output the number of gallons needed and the cost of the job. *Help me solve this question with step-by-step solution. Thank you in advance.arrow_forward
- Python questionarrow_forward9. All employees at Kranston Sports Inc. are paid based on an annual salary rather than an hourly wage. However, some employees are paid weekly, while others are paid every other week (biweekly). Employees paid weekly receive 52 paychecks; employees paid biweekly receive 26 paychecks. The algorithm shown in Figure 1-15 should calculate and display the gross pay for each employee; however, some of the instructions are missing from the algorithm. Complete the algorithm. repeat (for each employee) enter the employee's payment schedule and annual salary if (the employee's payment schedule is weekly) calculate gross pay calculate gross pay Figure 1-15arrow_forwardExercise 4 Write a program that allows a user to play HiLo game. User wins if he/she can guess the number between 1 and 100 within at most 6 iterations. • If s/he guesses a number greater than the secret number. The message shown is "It is Higher than secret shown" • If s/he guesses a number lower than the secret number. The message shown is “ It is Lower than secret" • If the guessed number equal to the secret number. The message shown is "Cong! you won" • If the user consumed the 6 trails without finding the secret number a message "Sorry! Try again" will be shown before termination. Output - CppApplication_1 (Run) #3 Enter a positive integer seed value: 100 Enter your guess : 40 It is Higher than secret Enter your guess : 20 It is Higher than secret Enter your guess : 10 It is Lower than secret Enter your guess : 15 It is Lower than secret Enter your guess : 17 It is Lower than secret Enter your guess : 18 Cong! you won PE Outputarrow_forward
- Periodic compounding The total accumulated value, including the principal sum P, is given by the formula: where: nt A = P(1 + 1) "² n A is the final amount Accumulated Value P is the original principal sum r is the nominal annual interest rate n is the compounding frequency t is the overall length of time the interest is applied (expressed using the same time units as r, usually years). Using the above formula write a program that will display the following table. Principal-Value | Times-Interest-Compunded | Annual-Int-Rate | Term | Accumulated-Value 1000 6.00% 10 3.20% 15 2000 3000 9.25% 10 2 ** 3 8 | You must use exponent operator to compute P Exponent Operator in Python is ** Examples m=3 n=2 p= m **n (https://en.wikipedia.org/wiki/Compound_interest) 1 2 4 base = 2 exp = 4 a = base ** exp print(a) 16 print("Solving the exponent, we get Solving the exponent, we get 9 ,p ) 1790.85 3219.89 7486.33arrow_forward26. A room has one door, two windows, and a built-in bookshelf and it needs to be painted. Suppose that one gallon of paint can paint 120 square feet. Write a program that prompts the user to input the lengths and widths of the door, each window, the bookshelf; and the length, width, and height of the room (in feet). The program outputs the amount of paint needed to paint the walls of the room.arrow_forward25. Repeat Programming Exercise 24, but the wire is to be bent in the form of a circle. In this case, the user specifies the length of the wire and the program outputs the radius and area of the circle. (You may assume that . Also declare it as a named constant.)arrow_forward
- C++ 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