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 Plus Mylab Programming With Pearson Etext -- Access Card Package (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)
- State which of the following are true and which are false. If false, explain your answer.c) The statement printf("a = 5;"); is a typical example of an assignment statementarrow_forwardwrite true or false for each of the following statements:arrow_forward-Convert SES variable to a factor and assign the value labels “low”, ”middle” and “high” to the 3 levels of thevariable. Then -Define the variables complic, comorb, depressi, diabetes as factors. For all these factors, a zero means “no” and a 1 means “yes”. Assign these value labels through the function factor() and check the change using str()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-I need someone to help me fix my code. Whenever I input my code and run it, I don't get an error but I also don't get an output. -Here is the guide: Using Python, use import sys to create a program Create a program change.py, that has a function that takes 5 arguments that correspond to the number of $1 dollar bills, quarters, dimes, nickels, andpennies, respectively. Calculate the total value of that change, and print "The total value of your change is $x" where x is equal to the total value. -Here is what I have so far: import sys dollar = int(sys.argv[1])quarters = int(sys.argv[2])dimes = int(sys.argv[3])nickels = int(sys.argv[4])pennies = int(sys.argv[5]) total = dollar*1 + quarters*0.25 + dimes*0.10 + nickels*0.05 + pennies*0.01 print("Total value of your change is $",total) python3 change.py 4 7 8 9 7  -Please provide a revised codearrow_forwardRewrite the following statements using combined assignment operators: length = length / 2;arrow_forward
- -Program C 2. Not my Favorites by CodeChum Admin We've already done looping through a series of numbers and printing out its squares, so how about we level it up and go with cubes this time?  I have a condition though; I don't want to be associated with numbers that are divisible by 3 or 5 so if an integer is divisible by either of the two, don't make their cube values appear on the screen, please.  Care to fulfill my request?  Instructions: Print out the cube values of the numbers ranging from 1 to 1000 (inclusive). However, if the number is divisible by either 3 or 5, do not include them in printing and proceed with the next numbers. Tip: When skipping through special values, make use of the keyword continue and put them inside a conditional statement. Output Multiple lines containing an integer. 1 8 64 343 512 . . .arrow_forward(Electrical eng.) The amplification of electronic circuits is measured in units of decibels, which is calculated as the following: 10LOG(Po/Pi) Po is the power of the output signal, and Pi is the power of the input signal. Using this formula, write, compile, and run a C++ program to calculate and display the decibel amplification, in which the output power is 50 times the input power. Verify your program’s result by doing a hand calculation. After verifying that your program is working correctly, use it to determine the amplification of a circuit, where output power is 4.639 watts and input power is 1 watt.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
- (General math) The perimeter, approximate surface area, and approximate volume of an in-ground pool are given by the following formulas: perimeter=2( length+width)volume=lengthwidthaveragedepthundergroundsurfacearea=2( length+width)averagedepth+lengthwidth Using these formulas as a basis, write a C++ program that accepts the length, width, and average depth measurements, and then calculates the pool’s perimeter, volume, and underground surface area. In writing your program, make these two calculations immediately after entering the input data:lengthwidthandlength+width. The results of these two calculations should be used as needed in the assignment statements for determining the perimeter, volume, and underground surface area without recalculating them for each equation. Verify your program’s results by doing a hand calculation, using the following test data :length=25feet,width=15feet,andaveragedepth=5.5feet. After verifying that your program is working, use it to complete the following chart:arrow_forwardWrite a statement (or comment) to accomplish each of the following: c) Define the variables x, y and z to be of type intarrow_forwardWhat’s the output of the following programs?arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning