Untitled
unknown
plain_text
3 years ago
959 B
6
Indexable
public class Main {
public static void main(String[] args) {
System.out.println("**** Part A ****");
Person p = new Person("Raya", "Whitker", 800555555);
p.display();
System.out.println("***** Part B *****");
Student s1 = new Student("Xavier", "Cato", 900111222, "CS", 3.5, 75);
s1.setTransfer(true);
s1.setBalance(100);
s1.addCourse("Java Programming");
s1.addCourse("Calculus");
s1.display();
if (s1.dropCourse("Spanish")){
System.out.println("The class has been dropped");
} else {
System.out.println("You are not enrolled in this course. " + "No courses have been dropped.");
}
ArrayList<String> enrolledCourses = s1.getEnrolledCourses();
System.out.println("You are enrolled in the following courses: ");
for(String course : enrolledCourses) {
System.out.println(course);
}
}
}
Editor is loading...