WQ= input(\'Enter weighting factor for quizzes\'); WH= input(\'Enter weighting f
ID: 3549554 • Letter: W
Question
WQ= input('Enter weighting factor for quizzes');
WH= input('Enter weighting factor for homework');
WF= input('Enter weighting factor for final exam');
CN= input('Enter course name and number','s');
Q= input( 'Enter the number of quiz grades');
sum= 0;
for i=1:Q
value= input ('Enter grade:');
sum= sum + value;
end
AQ= sum/Q;
H= input('Enter the number of Homework grades');
sum1= 0;
for j=1:H
value1= input('Enter grade:');
sum1=sum1 +value1;
end
AH= sum1/H;
F= input ('Enter 1 if the course has final exam grade. If not, press 0:');
if F==1
FE= input('Enter Final Grade:');
AG= (WQ* AQ + WH * AH + WF * FE)/ (WQ +WH + WF);
fprintf(CN);
fprintf (AG);
else
AG1= (WQ * AQ + WH* AH)/(WQ +WH);
fprint (CN)
fprintf (AG1);
end
Question: How do I display both AG/AG1 and course name/# ?
Explanation / Answer
WQ= input('Enter weighting factor for quizzes ');
WH= input('Enter weighting factor for homework ');
WF= input('Enter weighting factor for final exam ');
CN= input('Enter course name and number ','s');
Q= input( 'Enter the number of quiz grades ');
sum= 0;
for i=1:Q
value= input ('Enter grade: ');
sum= sum + value;
end
AQ= sum/Q;
H= input('Enter the number of Homework grades ');
sum1= 0;
for j=1:H
value1= input('Enter grade: ');
sum1=sum1 +value1;
end
AH= sum1/H;
F= input ('Enter 1 if the course has final exam grade. If not, press 0: ');
if F==1
FE= input('Enter Final Grade: ');
AG= (WQ* AQ + WH * AH + WF * FE)/ (WQ +WH + WF);
display(AG)
display(CN)
else
AG1= (WQ * AQ + WH* AH)/(WQ +WH);
display(AG1)
display(CN)
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.