Write a program to assist in the design of a hydroelectric dam. Prompt the user
ID: 3888384 • Letter: W
Question
Write a program to assist in the design of a hydroelectric dam. Prompt the user for the height of the dam and for the number of cubic meters of water that are projected to flow from the top to the bottom of the dam each sec- ond. Predict how many megawatts (1 MW = 106W) of power will be produced if 90% of the work done on the water by gravity is converted to electrical energy. Note that the mass of one cubic meter of water is 1000 kg. Use 9.80 meters/secondas the gravitational constant g. Be sure to use meaningful names for both the gravitational constant and the 90% efficiency constant For one run, use a height of 170 m and flow of 1.30 × 103 m3/s. The relevant formula (w = work, = mass, g = gravity, h = height) is: w = mghExplanation / Answer
#include <stdio.h>
int main()
{
double height;
double g_constant=9.8;
double flow;
double power;
double efficiency=0.9;
printf("Enter height of dam(m) ");
scanf("%lf", &height);
printf("Enter flow rate of water (m^3/sec) ");
scanf("%lf", &flow);
/*
power = mgh * efficiency)
*/
power = (flow*1000*g_constant*height* efficiency)/10000000;
printf("Power generated : %lf MW ",power);
return 0;
}
Output:
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.