New Program
Calculating a GPA
Overview: In this program, you will create a program that will allow the user to enter grades from their five classes. The program will then calculate a grade point average for that student and show them a grading scale.
Specifics:
Start a new program - save as GPA1.
This program will be a top-down program. Your main program should use the code below:
REM Your name
REM Your class info
REM Program info
GOSUB title.screen
GOSUB purpose
GOSUB enter.data
GOSUB calculate.gpa
GOSUB show.results
GOSUB show.grading.scale
END
After the END of your main: program, you should code the subroutines that are used. Here is an idea of what each subroutine should accomplish:
title.screen should start by clearing the output screen. Then, it should show your name, your class information, and the program information in the center of the screen, vertically and horizontally. The subroutine should pause for a couple of seconds before clearing again.
purpose should explain what the program is supposed to accomplish….why was it created? This information should show on the screen for a while.
enter.data should allow the user to enter a grade point number for each of their six classes (block1, block2…etc). The grade point number should be from the following scale:
|
Letter Grade |
Grade Point Number |
|
A |
4.0 |
|
A- |
3.7 |
|
B+ |
3.3 |
|
B |
3.0 |
|
B- |
2.7 |
|
C+ |
2.3 |
|
C |
2.0 |
|
C- |
1.7 |
|
D+ |
1.3 |
|
D |
1.0 |
|
D- |
0.7 |
|
E |
0 |
calculate.gpa should average the five numbers entered by the user in enter.data
show.results should clear the output screen and show the five numbers entered by the user along with the grade point average for all five classes.
show.grading.scale should show the following text on the screen:
Use
the table below to find out the grade equivalent of your GPA:
GPA
|
Letter Grade Equivalent |
|
3.85 - 4.0 |
A |
|
3.5 - 3.84 |
A- |
|
3.15- 3.49 |
B+ |
|
2.85 – 3.14 |
B |
|
2.5 - 2.84 |
B- |
|
2.15- 2.49 |
C+ |
|
1.85 – 2.14 |
C |
|
1.5 – 1.84 |
C- |
|
1.15- 1.49 |
D+ |
|
0.85 – 1.14 |
D |
|
0.6-0.84 |
D- |
|
<0.6 |
E |