Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Make a record to store information about a student, which should handle a name,

ID: 2294002 • Letter: M

Question

Make a record to store information about a student, which should handle a name, a grade classification, and Create three variables of type Student (You may need to create a class with instance field of name, grade and average score. Read in values for the three students and print them out again. an average. Give the average for all three students. Enter the first student's name: Esteban Enter the first student's grade: 12 Enter the first student's score: 79.3 Input: Enter the second student's name: Dave Enter the second student's grade: 10 Enter the second student's score : 91 Enter the third student's name: Michelle Enter the third student's grade: 11 Enter the third student's score: 98.6 The names are: Esteban Dave Michelle The grades are: 12 10 11 The averages are: 79.3 91 98.6 The average score for the three students is: 89.633333

Explanation / Answer

class PrintStudentDetailsUsingClasses
{
public static void main(String s[])
{
Student students[] = new Student[3];
  
  
  
students[0] = new Student();
System.out.print("Enter first student's name: ");
students[0].name = s.next();
System.out.print("Enter first student's grade: ");
students[0].grade = s.nextInt();
System.out.print("Enter first student's average score: ");
students[0].average score = s.nextInt();
  
students[1] = new Student();
System.out.print("Enter second student's name: ");
students[1].name = s.next();
System.out.print("Enter second student's grade: ");
students[1].grade = s.nextInt();
System.out.print("Enter second student's average score: ");
students[1].average score = s.nextInt();
  
  
students[2] = new Student();
System.out.print("Enter third student's name: ");
students[2].name = s.next();
System.out.print("Enter third student's grade: ");
students[2].grade = s.nextInt();
System.out.print("Enter third student's average score: ");
students[2].average score = s.nextInt();
  
int totalavrg= (students[0].average + students[1].average + students[2].average score)/3;
  


{
System.out.println( "The names are :" students[0].name+ " " + students[1].name+ " " + students[2].name );
System.out.println( "The grades are :" students[0].grade+ " " + students[1].grade+ " " + students[2].grade );
System.out.println( "The averages are :" students[0].average score+ " " + students[1].average score+ " " + students[2].average score );
System.out.println( "The average score for three students is :" totalavrg );
  
}
}

}

class Student
{
String name;
int grade;
int average score;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote