Question: 5 4 . 1 2 LAB: Create Gradebook using Arrays Write a program that asks users how many classes they have taken. Then, take the

54.12 LAB: Create Gradebook using Arrays
Write a program that asks users how many classes they have taken. Then, take the class name, the grade, and the number of credit hours for each class. Once the user enters the information for all classes the program prints out a table showing the course name, grade, and credit hours.
You will need to use three arrays, an array of strings representing the course name, another array of strings representing the letter grades, and an array of integers representing the number of credits each class was worth. A given class should have the same index in each one of these arrays.
Learning Objective: To use arrays to store different types of data
Sample Outputs:
Sample output 1:
```
Please enter the number of classes you have: 2
Please enter the class 1 name: CSE123
Please enter the class 1 grade: A
Please enter the class 1 credit hours: 4
Please enter the class 2 name: CSE456
Please enter the class 2 grade: B
Please enter the class 2 credit hours: 3
Class Grade Credit
CSE123 A 4
CSE456 B 3
```
Sample output 2:
```
Please enter the number of classes you have: 3
Please enter the class 1 name: CSE101
Please enter the class 1 grade: A
Please enter the class 1 credit hours: 4
Please enter the class 2 name: ENG200
Please enter the class 2 grade: B+
Please enter the class 2 credit hours: 6
Please enter the class 3 name: CSE220
Please enter the class 3 grade: B
Please enter the class 3 credit hours: 2
Class Grade Credit
CSE101 A 4
ENG200 B+6
CSE220 B 2
```
Hints: For all the arrays the size is the user input (number of classes). Use a formatted string to print out the table. When printing out the final table use tabs ("\t").
5 4 . 1 2 LAB: Create Gradebook using Arrays

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!