how can I satisfy all the conditions here? can't find any example online. I just don't know what code to use. I tried doing some coding but I know it was way off to what was actually ask to me. The problem was
"Write a java class called Student. The Student class will have four data members: name (astring), age (an int), semesterNo (an int), and GPA (a float). Write a java program to test your Student class. Your program should: Create three Student objects, enter their name, age, semesterNo (assuming a value from 1 to 8), and GPA(assuming value from 0.0 to 4.0) and display the data for each Student. Continuing the Student class, calculate and display the average GPA of the three Students.(user input required)"
and the code I come up was `
import java.util.Scanner;
class Student {
public static void main(String[] args) {
String name, name1, name2;
int age1, age2, age3, semesterNo1, semesterNo2, semesterNo3;
float GPA1, GPA2, GPA3, Average;
Scanner in = new Scanner(System.in);
System.out.print("Name:");
name = in.nextLine();
System.out.print("Age:");
age1 = in.nextInt();
System.out.print("Semester:");
semesterNo1 = in.nextInt(9);
System.out.println("GPA:");
GPA1 = in.nextFloat();
Scanner input = new Scanner(System.in);
System.out.print("Name:");
name1 = input.nextLine();
System.out.print("Age:");
age2 = input.nextInt();
System.out.print("Semester:");
semesterNo2 = input.nextInt(9);
System.out.println("GPA:");
GPA2 = input.nextFloat();
Scanner inputs = new Scanner(System.in);
System.out.print("Name:");
name2 = inputs.nextLine();
System.out.print("Age:");
age3 = inputs.nextInt();
System.out.print("Semester:");
semesterNo3 = inputs.nextInt(9);
System.out.println("GPA:");
GPA3 = inputs.nextFloat();
Average = (GPA1 + GPA2 + GPA2) / 3;
System.out.println("Average GPA:" + Average);
}
}
`