Guest User

Untitled

a guest
Mar 23rd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public void enroll() {
  2. // Get inside a loop, user hits Q to exit
  3. Scanner in = new Scanner(System.in);
  4. String course;
  5. do {
  6. System.out.print("Enter course to enroll (Q to quit): ");
  7. course = in.nextLine();
  8. courses = courses + "n" + course;
  9. tuitionBalance = tuitionBalance + costOfCourse;
  10. } while (course != "Q".toLowerCase());
  11. System.out.println("Enrolled in: " + courses);
  12. System.out.println("Tuition balance: " + tuitionBalance);
  13. }
Add Comment
Please, Sign In to add comment