GPA Program

Version 1

 

Overview:  You’ll create a program that calculates a Grade Point Average for a student based on 6 academic classes.

 

Specifics:

 

Create a subroutine called Enter.One.Student.  This subroutine clears the screen and  the user enters the following information – all related to one student:

(Note:  As you enter grades, you will be entering grades in decimal form.  (Ex:  You would enter 3.7 instead of “A-“.))

 

Create a subroutine called Calculate.GPA.  This sub essentially finds the average of the 6 grade scores.

 

Create a subroutine called Report.Student.  This sub shows the Last Name followed by a comma, followed by First Name.  Then it shows the grade for each class and a GPA at the end of the report.  Output should look as follows:

 

Offenbecker, Matthew

 

QBASIC Programming

4.0

C++ Programming        

4.0

Advanced Algebra       

4.0

Art               

1.0

Biology           

0.7

Chemistry              

1.3

 

 

GPA               

2.5

 

At the end of each student report, ask the user if they would like to enter another student.  The user should enter a y/n answer for yes or no.   Your loop condition should be based on their answer.  (Hint:  If you struggle with this, try using 1 = yes and 2 = no)

 

Required:  For each grade, use a data validation loop to make sure the user doesn’t enter a score higher than 4.0.  If you’re feeling zesty, you should also make it so they can’t enter scores lower than 0.

 

 

Your MAIN program structure will resemble the following:

 

REM

REM

REM

 

DO

                     Call subroutine #1

                     Call subroutine #2

                     Call subroutine #3

LOOP (y/n answer condition)

 

END