Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void enroll() {
- // Get inside a loop, user hits Q to exit
- Scanner in = new Scanner(System.in);
- String course;
- do {
- System.out.print("Enter course to enroll (Q to quit): ");
- course = in.nextLine();
- courses = courses + "n" + course;
- tuitionBalance = tuitionBalance + costOfCourse;
- } while (course != "Q".toLowerCase());
- System.out.println("Enrolled in: " + courses);
- System.out.println("Tuition balance: " + tuitionBalance);
- }
Add Comment
Please, Sign In to add comment