#include <stdio.h> #include <stdlib.h> int main (int argo, char* argv[]) { print
ID: 3628175 • Letter: #
Question
#include <stdio.h>
#include <stdlib.h>
int main (int argo, char* argv[])
{
printf("hello world ! "); // this is an example
system("pause");
return 0 ;
}
It is absolutely crucial to end all of your programs with:
return 0;
as the last line before the closing '}' bracket in your main function.
Programs that do not follow this convention will not be graded correctly.
Programs that end with that line may still fail because they do not generate the right output.
Each sample run is indicated by a line of "=" symbols. These lines only indicate
the start and the end of a sample run and should not be printed by your program.
Problem 5
#########
Write a program that predicts the score needed on a final exam to achieve a
desired grade in a course. The program should interact with the user as follows:
Make sure that the newline between the prompts and the output is
present. Make sure that the score is printed with two digits of
precision (i.e., "%.2f" in printf).
Remarks: In the sample run, the final counts as 25 percent of the course grade,
but this value may change is the user enters a different number.
============= START OF SAMPLE RUN =======================
Enter desired grade> B
Enter minimum average required> 79.5
Enter current average in course> 74.6
Enter how much the final counts
as a percentage of the course grade> 25
You need a score of 94.20 on the final to get a B.
============= END OF SAMPLE RUN =======================
Explanation / Answer
DEAR FRIEND i did my best to give u the exact result u want PLEASE RATE #include #include #include int main (int argo, char* argv[]) { char desired; double minimum; double current; double percent; double need; printf("Enter desired grade> "); scanf("%c",&desired); printf("Enter minimum average required> "); scanf("%lf",&minimum); printf("Enter current average in course> "); scanf("%lf",¤t); printf("Enter how much the final counts as a percentage of the course grade> "); scanf("%lf",&percent); percent=percent/100.; need=(minimum-current*(1.-percent))/percent; printf(" You need a score of %.2f on the final to get a %c. ",need,toupper(desired)); system("pause"); return 0 ; }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.