Can you please tell me why my code isn't working? It won't calculate the values I have using my input file.
/*******************************************************************************
AUTHOR SECTION
ENGR 200.07 DATE: 10/23/2020
PROGRAM:
********************************************************************************
PROGRAM DESCRIPTION
This program takes a pre-made .txt file’s input values, and
calculates the
kinetic energy wind farms produce from moving air into electrical
energy.
Using 3 different formulas this program calculates the available
power in the
wind, the maximum available power that can be produced, and the
amount of
electricity produced by the turbines in kW. Only the diameter of
the wind
blades, number of turbines, and power in kW will be printed on
screen. These
3 values will also be output to a designated .txt file. The input
and output
file locations can be found in the preprocessor directives section
of the
program. These file locations can also be altered, allowing for
other .txt
files with different input values to be used.
DESCRIPTION OF VARIABLES
NAME | TYPE | DESCRIPTION
-----------------------------------------------------------------------------
PW | double | Power available in wind
PWM | double | Maximum power the wind turbine can produce
PE | double | The amount of electricity (in Watts) that can
be
produced for each turbine
BD | double | Diameter of blades
BR | double | Radius of blades
NT | double | Number of turbines available
A | double | Area swept by blades (m^2)
V | double | Velocity of the wind (9.5 m/s)
P | double | Density of the air (1.2754 kg/m^3)
CP | double | Benz Limit (0.48 unitless)
N | double | Combined electricity of gear box, generator, and
bearings (.33)
PI | symbolic | Constant for pi (3.14159)
i | int | Loop control variable
ndata | int | Number of record lines in input file
*******************************************************************************/
/* Preprocessor directives */
#include
#include
#define PI 3.14159
#define inputfile "C:\\Users\\16614\\Desktop\\ENG
200\\farms.txt"
#define outputfile "C:\\Users\\16614\\Desktop\\ENG
200\\power.txt"
/* Main function */
int main(void)
{
/* Declare variables */
double PW, PWM, PE, BD, BR, NT, A, V, P, CP, N;
int i, ndata;
FILE *INP = NULL, *OUTP = NULL;
/* Open Files */
INP = fopen(inputfile, "r");
OUTP = fopen(outputfile, "w");
/* Print headings */
printf("\n********************************************");
printf("\n WIND FARM CONFIGURATIONS"
"\n\nDIAMETER NUMBER OF TURBINES POWER"
"\n (m) (kW)");
fprintf(OUTP,"\n********************************************");
fprintf(OUTP,"\n WIND FARM CONFIGURATIONS"
"\n\nDIAMETER NUMBER OF TURBINES POWER"
"\n (m) (kW)");
/* Verify input file */
if(INP==NULL)
{printf("\n\n COULD NOT FIND FILE"
"\n PROGRAM TERMINATED"
"\n********************************************");
return 1;
}
else
{
/* Read Control numbers */
fscanf(INP, "%i",&ndata);
/* Calculate Values using Formulas and Print Results */
for(i=1;i<=ndata;i++)
{
fscanf(INP,"%lf %lf",&BD,&NT);
V = 9.5;
P = 1.2754;
CP = 0.48;
N = 0.33;
BR = 1/2*BD;
A = PI*pow(BR,2);
PW = 1/2*P*A*pow(V,3);
PWM = CP*PW;
PE = N*PWM;
printf("\n %3.1f %3.0f %5.1f",BD,NT,BR);
fprintf(OUTP,"\n %3.1f %3.0f %5.1f",BD,NT,BR);
}
}
printf("\n********************************************\n\n\n");
fprintf(OUTP,"\n********************************************\n\n\n");
/* Exit the program */
return 0;
}
/******************************************************************************/
In: Computer Science
The production function for an entire economy is typically viewed as an aggregate of all the microeconomic firm-level production functions. The figure below depicts such an aggregate production function for an economy. The economy is currently at point A in the figure below.
In 2011, a major earthquake and tsunami in Japan destroyed significant physical capital, including roads, homes, factories, and bridges. Using your knowledge of the Solow model of economic growth, what would be the effect on the aggregate production function of such a destruction of physical capital in Japan? Shift the curve, or shift the point on the production function, to depict the impact of the destruction of physical capital.

In: Other
Which of the following statements is true?
a. Due to the strength of covalent bonds, the tertiary structures of most proteins are stabilized by one or more disulfide bridges.
b. Salt bridging interactions usually provide the greatest degree of stabilization of the native conformation of the protein when they are located on surfaces exposed to water.
c. Ramachandran plots are used in determining the hydrophobicity of amino acid side chains in a protein.
d. Detergents cause the denaturation of proteins primarily via disruption of hydrophobic interactions between amino acid side chains.
e. All of the above statements are true.
In: Chemistry
Is the following the correct order of steps leading to muscle contraction? (Yes or No)
If you think the order is incorrect, then what would be the correct order?
a. secretion of acetylcholine by the motor neuron
b. attachment of acetylcholine to receptors on the motor end plate of the sarcolemma
c. opening of sodium channels in the sarcolemma
d. depolarization of the sarcolemma
e. action potential reaching the sarcoplasmic reticulum
f. release of calcium ions by the sarcoplasmic reticulum
g. binding of calcium ions to troponin on the thin filament
h. binding of myosin to actin (formation of cross bridges)
i. power stroke
In: Anatomy and Physiology
When the U.S. Government proposes a fiscal stimulus package during a recession there is usually a debate in Congress as to whether the Government should: 1) increase spending directly such as building bridges and schools; or 2) reduce personal income taxes. Using the concepts of U.S. GDP accounting based on the expenditure approach: (p. 749 ch 30)
In: Economics
Download and complete this assignment by answering the questions or filling in the blanks!
|
Week 3 Assignment.docx |
In: Biology
using java program
I need only the tracing in detail, using my name "Nada Hamdan"
Part-A:
Consider first ten letters of your name and for each letter encode with an integer number. For example: If “Ahmed Naser” are the first ten letters from your name, then the array of integers will be {0, 7, 12, 4, 3,13,0,18,4,17}.
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
|
a |
b |
c |
d |
e |
f |
g |
h |
i |
j |
k |
l |
m |
n |
o |
p |
q |
r |
s |
t |
u |
v |
w |
x |
y |
z |
Using the created array, demonstrate below sorting algorithms. It is very important that in each demonstration includes all intermediate arrays in obtaining the final sorted output.
Bubble Sort
Selection Sort
Insertion Sort
Shell Sort
Merge Sort
Quick Sort
In: Physics
One cross-sectional study found that shingles was more common in lower socioeconomic status (SES) groups compared to higher SES groups. A later cohort study which analyzed the incident rate of shingles in both high and low SES groups found no difference among high and low SES groups. The difference in findings could most likely be explained by:
1. Information bias
2. the incidence-prevalence bias
3. the reverse-causality bias
4. 1) Information bias and 3) the reverse-causality bias
In: Statistics and Probability
Cohort Study Design
Suppose that you have been hired by the UF student health services department to design a cohort study to assess the following hypothesis among UF students: Irregular sleep patterns increase the risk of headaches.
Be sure that your design addresses the following elements:
In: Advanced Math
In an article in the Archives of Your Specialty, researchers report that screening Test T is enormously effective, and should be used routinely. As evidence, they report that the five-year survival rate of patientsS whose disease was discovered by screening with Test T is 90%, whereas the five-year survival rate of patients whose disease was discovered by other means is only 60%. However, in an article that same month in the Journal of the College of Your Specialty, another group of researchers report that screening with Test T has no effect. As evidence, they report that a study which randomized subjects to a program of routine screening with Test T or to no special screening regimen found an 80% five-year survival rate in both groups. The issue seems even more confusing because this second group of investigators acknowledges that if their data are reanalysed to compare the survival rate of subjects who actually followed the screening regimen to those who did not, whatever group they were assigned to, the cohort of those who actually were screened had five year survival of 85% whereas the cohort of those who were not had survival of only 75%. Despite this, these investigators maintain the position that no effect of screening has been demonstrated. Write a brief note for the General Practitioner's Quick Office Practice Digest, explaining why these various sets of results might be expected to in the way they do and advising whether or not to screen with Test T
In: Statistics and Probability