I have a question regarding Java.
I have this class
public class TestProgram {
public static void main(String[] args) {
Student s = new Student("Olof", "Andersson", 2);
s.addCourse("IOOP");
s.addCourse("Declarative programming");
s.addCourse("Logic I");
s.setCurrentCourse("ItaSAfA");
s.print();
Student q = new Student();
q.setName("Goran", "M.");
q.setCurrentCourse("Philosophy of Information");
q.print();
q.setYear(3);
q.print();
System.out.println();
System.out.println(s.getName() + " is taking course in " + s.getCurrentCourse());
System.out.println(q.getName() + " is taking course in " + q.getCurrentCourse());
}
}
public Student()
public Student(String, String)
public Student(String, String, int)
public void setName(String, String)
public String getName()
public void setCurrentCourse(String)
public String getCurrentCourse()
public void setYear(int)
public int getYear()
public void addCourse(String)
public void print()
private void printCourses()
The class Student have the following class variables
name, surname, year, currentCourse, and finishedCourses
I want the following result from the program
Name: Olof Andersson
Year: 2
Currently taking course in ItaSAfA
Finished courses:
IOOP
Declarative programming
Logic I
Incomplete information about the student.
Name: Goran M.
Year: 3
Currently taking course in Philosophy of Information
Finished courses:
Olof Andersson is taking course in ItaSAfA
Goran M. is taking course in Philosophy of Information
Can do the class Student looks like?
Best regads
/Nina
What I have tried:
Pls help me, new in Java. Do not how to start.