// 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 Main Module() Declare variables and constants DECLARE Real avg= 0.0 DECLARE total=0.0 DECLARE grades[1...4] of Integers //Use an array to store the grades DECLARE Integer i FOR i=0 to 4 //Use a looping structure to populate the array DISPLAY "Enter the "& (i+1) & " grade:" INPUT grades[i] End FOR FOR i=0 to 4 //Display each of the 4 numeric grades from the array on the screen using a looping structure DISPLAY "Grade "& (i+1) &" is "& grades[i] End FOR CALCULATE avg=total/4.00 //calculate average DISPLAY "The average is "& avg & "and Letter grade is "& returnGrade(avg) //display average and grade letter // Thank the user and end the program DISPLAY"Thank you for using this program." End Module() //End of the main module DECLARE String returnGrade(Real avg){ //function to determine the grade letter of the average DECLARE String grade="" //variable to hold the grade letter If avg>=90 && avg<=100 // check if average is in the range 90-100 inclusive and assign A to grade letter. grade="A" Else If avg>=80 && avg <=89 // check if average is in the range 80-89 inclusive and assign B to grade letter. grade="B" Else If avg>=70 && avg <=79 // check if average is in the range 70-79 inclusive and assign C to grade letter. grade="C" Else If avg>=60 && avg<=69 // check if average is in the range 60-69 inclusive and assign D to grade letter. grade="D" Else If(avg>=0 && avg<=59) //// check if average is in the range 0-59 inclusive and assign E to grade letter. grade="F" Else grade=" " End If RETURN grade }