Write a program to read in a collection of exam scores ranging in value from 0 t
ID: 3544029 • Letter: W
Question
Write a program to read in a collection of exam scores ranging in value from 0 to 100. Your program should display the category of each score. It should also count and display the number of outstanding scores (90 to 100), the number of satisfactory scores (60 to 89), and the number of unsatisfactory scores (0 to 59). Your program should display the average score at the end of the run. Your program should ensure that each score is valid (in the range 0 to 100).
Chapter 5 Programming Project Analysis and Design Sheet
Program Inputs:
Program Outputs:
Program Algorithm:
Program Test Plan:
Program Test Results:
Functions
(Repeat this section for each of your functions). Provide the function prototype here.
Function Analysis:
Function Preconditions and Post Conditions:
Function Inputs and Outputs:
Function formulas:
Function Algorithm:
PLEASE WRITE THE PROGRAM ANALYSIS ASWELL..THAT IS THE MOST IMPORTANT PART
Explanation / Answer
I have written the complete working code for you.
Do rate my efforts :)
#include <stdio.h>
int main()
{
int N;
printf("Enter the number of scores ");
scanf("%d",&N);
int array[N];
int i;
for(i=0;i<N;i++)
{
scanf("%d",&array[i]);
if(array[i]<0 || array[i]>100)
{
printf("Invalid score, please enter a valid score ");
i--;
continue;
}
else
{
if(array[i]>=90 && array[i]<=100)
{
printf("Outstanding ");
}
else if(array[i]>=60 && array[i]<=89)
{
printf("Satisfactory ");
}
else if(array[i]>=0 && array[i]<=59)
{
printf("Unsatisfactory ");
}
}
}
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.