// Program Name: Grade Average
// Purpose: To avegerage the grades
// Author Name: Courtney Credle
// Class Name and Number: Program design and developement
CIST1305
// Instructor Name: Todd Meadors
// Last date modified: 24-July-2017
Declare variables and constants
Declare avg= 0.0, total=0.0;
Declare grades=[]; //Use an array to store the grades
Display(i=0;i<4;i++) //Use a looping structure to populate the array
Display("Enter the " + (i+1) + " grade");
grades[i]=input;
Display(i=0;i<4;i++)//Display each of the 4 numeric grades from the array on the screen using a looping structure
Declare(grades[i]);//getting the total
Display("result").innerHTML=Display ("result").innerHTML+"
The"+(i+1)" marks is: "+grades[i];
// Declare getting and printing average
avg=total/4.00;
Display grade=returnGrade(avg)
Declare("result").innerHTML=Declare("result").innerHTML+"
The average is: "+avg+" ("+grade+")";
Start Function
Display returnGrade(avg)
Declare grade="";
if(avg>90 && avg<=100)
grade="A";
else if(avg>+80 && avg <=89)
grade+"B";
else if(avg>=70 && avg <=79)
grade="C";
else if (avg>=60 && avg<=69)
grade="D"
else
grade="F";
return grade
Stop Function
// Thank the user and end the program
Display("Thank you for using this program.");