Concept explainers
(Modified Compound-Interest
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Java How to Program, Early Objects Plus MyLab Programming with Pearson eText -- Access Card Package (11th Edition)
Additional Engineering Textbook Solutions
Concepts of Programming Languages (11th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting Out with C++: Early Objects (9th Edition)
Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- [Twenty-first question]arrow_forward(Python matplotlib or seaborn) CPU Usage We have the hourly average CPU usage for a worker's computer over the course of a week. Each row of data represents a day of the week starting with Monday. Each column of data is an hour in the day starting with 0 being midnight. Create a chart that shows the CPU usage over the week. You should be able to answer the following questions using the chart: When does the worker typically take lunch? Did the worker do work on the weekend? On which weekday did the worker start working on their computer at the latest hour? cpu_usage = [ [2, 2, 4, 2, 4, 1, 1, 4, 4, 12, 22, 23, 45, 9, 33, 56, 23, 40, 21, 6, 6, 2, 2, 3], # Monday [1, 2, 3, 2, 3, 2, 3, 2, 7, 22, 45, 44, 33, 9, 23, 19, 33, 56, 12, 2, 3, 1, 2, 2], # Tuesday [2, 3, 1, 2, 4, 4, 2, 2, 1, 2, 5, 31, 54, 7, 6, 34, 68, 34, 49, 6, 6, 2, 2, 3], # Wednesday [1, 2, 3, 2, 4, 1, 2, 4, 1, 17, 24, 18, 41, 3, 44, 42, 12, 36, 41, 2, 2, 4, 2, 4], # Thursday [4, 1, 2, 2, 3, 2, 5, 1, 2, 12, 33, 27, 43, 8,…arrow_forward(Display patterns using loops) Use nested loops that display the following patterns in two separateprograms: pattern A Pattern B Pattern c 123456 1 3 1 6 1 2 3 3 3 1 6 1 2 3 4 5 3 3 3 1 6 1 2 3 4 5 6 7 3 3 1 6 1 2 3 4 5 6 7 8 9 3 123456arrow_forward
- 1)use two list one for names and one for cost 2) keep total cost you will spend and print the average cost for a gift - ????? could you do this with just one list??? 3) after end of loop print the two list and the average and the number of name and number of cost in the list. (suggestion - use for loop) USE this Program: Holiday = []name = input("enter name").upper()while name != "XXX":cost = float(input("enter amount to spend >0 and <=10"))while cost <=0 or cost >10:print("invalid cost")cost = float(input("enter amount to spend >0 and <=10"))gift = name + " " + str(cost)Holiday.append(name)Holiday.append(cost)Holiday.append(gift)name = input("enter name").upper()print(Holiday)arrow_forward(C++ language)arrow_forward(Written in C) Create a payroll program to store and calculate the payroll for a small company as follows:Create an array of floats that is 4 rows and 50 columns, with the columns being the number of employeerecords stored in the array.Program parameters are as follows:Create a menu in a function menu and call it with the following options (use a do-while loop):A or a to add employee infoD or d to display employee infoT or t to display total payrollS or s to display the info of all employeesC or c to display the count of employees present in the arrayF or F to delete a recordZ or z to exit programThe information for each employee is: employee number, hours worked, pay rate per hour, taxdeduction.Option A or a:Call the function possible to check and if the index returned is 50 then output a msg saying that thearray is full. If the index returned is less than 50 the call the function add, pass to it the available index asthe third argument and the function will ask the user for one…arrow_forward
- Net Salary Calculator (Toy Problem)Write a program whose major task is to calculate an individual’s Net Salary by getting the inputs of basic salary and benefits. Calculate the payee (i.e. Tax), NHIFDeductions, NSSFDeductions, gross salary, and net salary.arrow_forwardPYTHON (Do not use functions) Write a program using a Loop structure that takes 5 inputs of sales for item 1 – item 5 from the user during runtime. The program use Running -Total to calculate the sales. The program applies 7% SalesTax The program gives a discount of 5% if the total sales are greater than $6000 The program gives a discount of 6% if the total sales are greater than $7000 The program validates the input as numbers only (Must Enter a Number) Provide different outputs to cover (1-6) The 5 items entered for sales calculations The subtotal of sales without taxes The total sales with taxes The final total of no discount < $6000 The final total of discount if sales > $6000 The final total of discount if sales > $7000arrow_forward(python) Study the following code, specifically the loop. _sum = 10 for k in range (2, 20, 3): _sum = _sum + (2*k) if _sum > 100: print("exceeded 100") Now, rewrite the for loop (for k in range(2, 20, 3):)to be a while loop that accomplishes the same objective. You don't need to show/use the other lines.arrow_forward
- Problem3: Looping: (30 points)Create a program flowchart that generates and displays the Fibonacci sequencenumbers of n(as input). In Fibonacci, the current third number is the sum of two previousnumbers. Sample input/output dialogue:Enter a no. 9Fibonacci series : 1 1 2 3 5 8 13 21 34Your flowchart and pseudocode here…...pls help me :(arrow_forwardiii) In the Python language, write a program to find the sum of all odd natural numbers less than 200. Use a for in range loop to find the sum.arrow_forwardIn C have the user enter their beginning principal balance (must be a float greater than zero).If not a float greater than zero, have the user enter again. (Use a do-while loop)Have the user enter their desired annual interest rate (must be a float greater than zero and less than 15%).If not a float greater than zero and less than 15%, have the user enter again. (Hint: Use a do-while loop)Have the user enter their desired number of quarters (must be an integer greater than zero or less than orequal to 44).If not an integer greater than zero and less than or equal to 44, have the user enter again. (Hint: Use a do-while loop)Display all of the information entered in steps 1-6 as seen in the display window below..Ask the user if all of the values are correct. If yes, proceed with step 9. If no, return to step 1. (Hint: Use ado-while loop)For each quarter, calculate and display the beginning principal balance, the interest earned, and the finalprincipal balance for the quarter using a for…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