Getname is on a work term else return thisgetname

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS133 Course Notes The CoopStudent class public void setWorkTerm(boolean status) { } public String location() { if (isOnWorkTerm) { return this.getName() + " is on a work term."; } else { return this.getName()+ " is on campus."; } } } Lecture 14, Slide 21 CS133 Course Notes Lecture 14, Slide 22 this.isOnWorkTerm = status; from Student class 21 22 Example: CoopStudent > CoopStudent chantelle = new CoopStudent("Chantelle", 5555555); > System.out.println(chantelle.getName()); ___________________ > chantelle.onWorkTerm(true); > System.out.println(chantelle.calcFees()); ___________________ > chantelle.addCourse("ECE 476"); > chantelle.onWorkTerm(false); > System.out.println(chantelle.calcFees()); ___________________ > System.out.println(chantelle.location()); Terminology ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online