California State University, Northridge



|[pic] |College of Engineering and Computer Science |

| |Computer Science Department |

| |Computer Science 106 |

| |Computing in Engineering and Science |

| |Spring 2006 Number Instructor: Larry Caretto |

Solution to Midterm Exam

1. (30 points) The power output of a hydroelectric dam, P, is given by the formula P = [pic], where η is the efficiency of the hydroelectric turbines expressed as a fraction, [pic]is the mass flow rate of water through the turbine in kg/s, h is the height of the water about the turbines in meters and g = 9.808 m/s2 is the gravitational acceleration. With the units specified for the input data, P has units of watts. This number is divided by a conversion factor of 106 watts per MW to get the power output in megawatts, MW. Write the statements necessary to (1) define g as a symbolic constant, (2) prompt a user to enter the efficiency, mass flow rate, and water height in correct units, (3) get the input from the user, and (4) compute and print the power output in megawatts. (You do not have to write a complete C++ program, only the statements necessary to accomplish the stated tasks and to declare the variables that you use.)

const double g = 9.808

double mDot, height, efficiency;

cout > mDot;

cout > efficiency;

cout > height;

double power = efficiency * mDot * g * height * 1e-6;

cout ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download