Skip to main content
ICT
Lesson A12 - Iterations
 
Main Previous Next
Title Page >  
Summary >  
Lesson A1 >  
Lesson A2 >  
Lesson A3 >  
Lesson A4 >  
Lesson A5 >  
Lesson A6 >  
Lesson A7 >  
Lesson A8 >  
Lesson A9 >  
Lesson A10 >  
Lesson A11 >  
Lesson A12 >  
Lesson A13 >  
Lesson A14 >  
Lesson A15 >  
Lesson A16 >  
Lesson A17 >  
Lesson A18 >  
Lesson A19 >  
Lesson A20 >  
Lesson A21 >  
Lesson A22 >  
Lesson AB23 >  
Lesson AB24 >  
Lesson AB25 >  
Lesson AB26 >  
Lesson AB27 >  
Lesson AB28 >  
Lesson AB29 >  
Lesson AB30 >  
Lesson AB31 >  
Lesson AB32 >  
Lesson AB33 >  
Vocabulary >  
 

LAB ASSIGNMENT A12.4 page 15 of 18

Grades

Background:

Suppose that a high school district decided on the following academic standards for a student's eligibility to participate in extracurricular activities, such as athletics, music, or drama, etc.:

  1. No F's.
  2. Minimum 2.0 grade point average (gpa)
    Note: A = 4.0, B = 3.0, C = 2.0, D = 1.0, F = 0
  3. Enrollment in a minimum of four academic classes

Assignment:

  1. Write a program that accepts the letter grades for a student, calculates the student's gpa, and prints it out, along with one of the following five messages:

    Eligible
    Ineligible, taking less than 4 classes
    Ineligible, gpa below 2.0
    Ineligible, gpa above 2.0 but has F grade (note: gpa >= 2.0)
    Ineligible, gpa below 2.0 and has F grade

  2. Your program must use an appropriate sequence of nested if-else statements to print out the appropriate message.

  3. The message "Ineligible, taking less than 4 classes" has priority over the other 3 ineligible cases.

  4. The class will not ask the user for how many grades are in a student's report card. The program will continue to read grades until a non-grade character is input. At this point, some type of loop will cease and the program prints the GPA value and the eligibility message.

  5. Example of run output:        GPA = 3.75        Eligible

  6. You do not have to print out any of the individual grades.

  7. Your program should allow input of grades in either upper or lower case.

Instructions:

  1. Use these 6 sample report cards (with a grade for each academic class) as inputs for your run outputs:
B B C B F
C B D D D C
C D C
A A B A A B A
A B A
D C F F D

 

Main Previous Next
Contact
 © ICT 2006, All Rights Reserved.