Concept explainers
(Find the largest) The process of finding the largest number (i.e., the maximum of a group of numbers) is used frequently in computer applications. For example, a
a) counter-A counter to count to 10 (i.e., to keep track of how many numbers have been input and to determine when all 10 numbers have been processed).
b) number-The current number input to the program.
c) largest-The largest number found so far.
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
C++ How to Program (10th Edition)
Additional Engineering Textbook Solutions
Essentials of Systems Analysis and Design (6th Edition)
Database Concepts (8th Edition)
Big Java Late Objects
Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with Python (4th Edition)
Computer Science: An Overview (12th Edition)
- need help with these. a flowchart and a code written in c languagearrow_forward(Algebra: solve 2 x 2 linear equations) You can use Cramer's rule to solve the following 2 x 2 system of linear equation: ax + by = e ed – bf af- ec ad - bc cx + dy = f ad – bc y = Write a program that prompts the user to enter a and f and display the result. If ad - bc is 0 b, c, d , e, , report that The equation has no solution.arrow_forward(Python) Please write a program that creates steps. You are expected to take in a single positive integer which will be used as the number of steps in your staircase. The program only accepts integers greater than 0 and less than 500. If 0 is entered a message stating "Your staircase has no steps." and if the user enters a value greater than or equal to 500, a message stating "I can't build a staircase that tall." For all other values not within the valid range or not integers an "Invalid staircase size provided." will be displayed to the user. The program will always run only once for each user input. One thing to note, the messages should be the return string from your printSteps() function and printed from the calling function. Additional Requirements: The very first step in the staircase will be left-aligned and for each subsequent level, the step will move above and to the right of the prior step. There are no spaces after the right of any of the steps. The bottom-most row ends…arrow_forward
- Create code for this. (C language only)arrow_forwardChange Return Program: (Write a python program for the following) The user enters a cost and then the amount of money given. The program will figure out the change and the number of twenty-dollar bills, ten-dollar bills, five-dollar bills, single-dollar bills, quarters, dimes, nickels, pennies needed for the change. You must have the maximum amount of higher denominations possible before allowing for lower denominations. For example, If your change is $18.88, You must have One Ten-dollar bill, One Five-dollar bill, Three singles, Three quarters, One dime and three pennies. There should be no nickels; No three Five-dollar bills etc.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
- Please review the image below. Produce the program in C++. Upload screenshots of Code and Output, as well as the source code. 5arrow_forward(Bar-Chart Printing Program) One interesting application of computers is drawing graphsand bar charts. Write a program that reads five numbers (each between 1 and 30). For each numberread, your program should print a line containing that number of adjacent asterisks. For example,if your program reads the number seven, it should print *******.arrow_forward(Electrical eng.) a. The voltage gain of an amplifier is given by this formula: voltagegain=[275 23 2 +0.5 f 2 ]n f is the frequency in Hz. n is the number of stages in the amplifier. Using this formula, write, compile, and run a C++ program to determine the value of the voltage gain for a four-stage amplifier operating at a frequency of 120 Hz. Your program should produce the following display: At a frequency of xxxxx hertz, the voltage gain is yyyyy Your program should replace xxxxx with the frequency and yyyyy with the voltage gain. b. Manually check the value your program produces. After verifying that your program is working correctly, modify it to determine the voltage gain of a 12-stage amplifier operating at a frequency of 9500 Hz.arrow_forward
- (Biology) The number of bacteria, B, in a culture that’s subject to refrigeration can be approximated by this formula: B=300000e0.032t e is Euler’s number 2.71828 (rounded to five decimal places). t is the time in hours the culture has been refrigerated. Using this formula, write, compile, and run a C++ program that prompts the user for a value of time, calculates the number of bacteria in the culture, and displays the result. For testing purposes, check your program by using a test input of 10 hours. After verifying your program, use it to determine the number of bacteria in the culture after 12, 18, 24, 36, 48, and 72 hours.arrow_forward(Sum the digits in an integer) Programming Exercise 2.6 prompts the user to enter an integer between 0 and 1000, and displays the sum of all digits in the integer. Write a program that prompts the user to enter a three-digit integer. The program displays the sum of all digits in the integer if the input is valid; otherwise, it displays a message indicating that the integer is not a three-digit number and hence, is invalid. Use C++ program.arrow_forward(C++ language)arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr