C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
bartleby

Videos

Textbook Question
Book Icon
Chapter 5.6, Problem 3E

(Electrical eng.) a. An electrical manufacturer tests five generators by measuring their output voltages at three different times. Write a C++ program that uses a nested loop to enter each generator’s test results, and then computes and displays the average voltage for each generator. Assume the following generator test results:

1 s t   g e n e r a t o r :   122.5   122.7   123.0 2 n d   g e n e r a t o r :   120.2   127.0   125.1 3 r d   g e n e r a t o r :   121.7   124.9   126.0 4 t h   g e n e r a t o r :   122.9   123.8   126.7 5 t h   g e n e r a t o r :   121.5   124.7   122.6

b. Modify the program written for Exercise 3a to calculate and display the average voltage for all the generators. (Hint: Use a second variable to store the total of all the generator’s voltages.)

Blurred answer
Students have asked these similar questions
-Program C 3. Negative Allergy by CodeChum Admin Whole numbers are great, but I think we should also pay attention to decimal numbers, too.   So, how about we make a program that involves a lot of decimals?   Instructions: Continuously ask for floating point values (decimal numbers) using the do…while() loop, sum them all up, and store the total into one variable. The loop shall only terminate for the following reasons: A negative decimal number is inputted (but still included in the total sum) The total sum reaches 100.0 or more Input 1. A series of float numbers Output The first multiple lines containing message prompts for float numbers. The last line contains the sum with 2 decimal places. Enter·a·number:·1.1 Enter·a·number:·1.2 Enter·a·number:·1.3 Enter·a·number:·1.4 Enter·a·number:·-1.0 Sum·=·4.00
5. (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 cx + dy = f ● x = ed - bf bc ad y = af - ec ad bc - Write a program that prompts the user to enter a, b, c, d, e, and f and display the result. If ad- bc is 0, report that The equation has no solution. Enter a, b, c, d, e, f: 9.0, 4.0, 3.0, -5.0, -6.0, -21.0 Enter x is -2.0 and y is 3.0 Enter a, b, c, d, e, f: 1.0, 2.0, 2.0, 4.0, 4.0, 5.0 Enter The equation has no solution
(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 *******.

Chapter 5 Solutions

C++ for Engineers and Scientists

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Boolean Algebra - Digital Logic and Logic Families - Industrial Electronics; Author: Ekeeda;https://www.youtube.com/watch?v=u7XnJos-_Hs;License: Standard YouTube License, CC-BY
Boolean Algebra 1 – The Laws of Boolean Algebra; Author: Computer Science;https://www.youtube.com/watch?v=EPJf4owqwdA;License: Standard Youtube License