repl.it
@Brawn/

Student Warmup

Java

No description

fork
loading
Files
  • Main.java
  • Student.java
Main.java
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
/*****************************************************
* NOTE: Part 1 of the warmup is in the Student class *
******************************************************/

class Main {
  public static void main(String[] args) {
    
    //Do these in ORDER
    //2. create a Student to represent 
    //   Lisa Simpson, id 55555
    Student l = new Student("Lisa Simpson", 55555);

    //3. Ask the Student for its id 
    //   (you might need to add something 
    //    to the Student class!)
	int id = l.getId();

    //4. Change the student's name to be 
    //   Bart Simposn (identity theft!) 
    //   [you might need to add something 
    //    to the Student class!]
	l.changeName("Bart Simposn");

    //5. Print out the Student object
    //   [you might need to add something 
    //    to the Student class!]
	String name = l.getName();
	System.out.print(name);
  }
}
?