The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 2 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
I am having problems getting the code to work. Can someone please help me with correcting it. The project is due tomoorow. It has to look similar to my pseudocode. I tried to use the d// 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
}
ebugger to figure it out but can not find the problem can someone please help fix this
----------- He-----------llo----------- Si-----------r/M-----------ada-----------m -----------Tha-----------nk -----------you----------- fo-----------r y-----------our----------- in-----------ter-----------est----------- an-----------d b-----------uyi-----------ng -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------. P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll -----------be -----------qui-----------ckl-----------y