A Table of Student Grades Write a Java program that prints a table with a list o
ID: 3592574 • Letter: A
Question
A Table of Student Grades Write a Java program that prints a table with a list of at least 5 students together with their grades earned (lab points, bonus points, and the total) in the format below Student Points Name Lab Bonus Total Joe William Mary Sue 43 50 39 50 58 49 10 The requirements for the program are as follows 1. Print the border on the top as illustrated (using the slash and backslash characters) 2. Use tab characters to get your columns aligned and you must use the + operator both for addition and string concatenation. 3. Make up your own student names and points- the ones shown are just for illustration purposes. You need 5 namesExplanation / Answer
public class Display { //Declare the name of the class
public static void main(String args[]) {//Initialize the main method
String students[] = new String[]{ "Alexis", "Walker", "Leonard", "Baley", "Ronaldo"};//Initialize an array to store Name of Students
int lab[] = new int[]{40, 38, 45, 50, 50};
int bonus[] = new int[]{4, 3, 5, 4, 5};
System.out.println("//////////////////\\\\\\\\\\\\\\\\\");
System.out.println("== Student Points ==");
System.out.println("//////////////////\\\\\\\\\\\\\\\\\ ");
System.out.println("Name Lab Bonus Total");
System.out.println("---- --- ----- ----- ");
for(int i = 0; i < 5; i++){//A loop to display all five values
System.out.println(students[i]+" "+lab[i]+" "+bonus[i]+" "+(lab[i]+bonus[i]));
}
}
}
I HOPE THIS HELPS.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.