Question: 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
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 :
Please enter the number of classes you have: Please enter the class name: CSE Please enter the class grade: A Please enter the class credit hours: Please enter the class name: CSE Please enter the class grade: B Please enter the class credit hours: Class Grade Credit CSE A CSE B
Sample output :
Please enter the number of classes you have: Please enter the class name: CSE Please enter the class grade: A Please enter the class credit hours: Please enter the class name: ENG Please enter the class grade: B Please enter the class credit hours: Please enter the class name: CSE Please enter the class grade: B Please enter the class credit hours: Class Grade Credit CSE A ENG B CSE B
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 Learning Objective: To use arrays to store different types of data
Sample Outputs:
Sample output :
Please enter the number of classes you have:
Please enter the class name: CSE
Please enter the class grade: A
Please enter the class credit hours:
Please enter the class name: CSE
Please enter the class grade: B
Please enter the class credit hours:
Class
Grade
Credit
CSE
A
CSE
B
Sample output :
Please enter the number of classes you have:
Please enter the class name: CSE
Please enter the class grade: A
Please enter the class credit hours:
Please enter the class name: ENG
Please enter the class grade: B
Please enter the class credit hours:
Please enter the class name: CSE
Please enter the class grade: B
Please enter the class credit hours:
: LAB: Create Gradebook using Arrays
import java.util.Scanner;
public class Main
public static void mainString args
Scanner input new ScannerSystemin;
TODO: assemble code and print output
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
