forked from cs-dept-ibbul/java2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab4studentdemo.java
More file actions
34 lines (24 loc) · 945 Bytes
/
Copy pathLab4studentdemo.java
File metadata and controls
34 lines (24 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.util.Scanner;
public class StudentDemo
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.println("Please enter your name");
String name = input.nextLine();
System.out.println("Please enter your ID");
int id = input.nextInt();
System.out.println("Please enter your Quiz Grades");
System.out.println("Quiz 1: ");
double q1 = input.nextInt();
System.out.println("Quiz 2: ");
double q2 = input.nextInt();
System.out.println("Quiz 3: ");
double q3 = input.nextInt();
Student student = new Student(name, id, q1, q2, q3);
student.printDetails();
System.out.println("Enter new grade for quiz 3: ");
student.setQuizThree(input.nextDouble());
student.printDetails();
}
}