Question: Write the inputLessons ( ) method in the Collection class. Within inputLessons ( ) , repeat the following until currLesson's readTopicAndDiscount ( ) method returns
Write the inputLessons method in the Collection class. Within inputLessons repeat the following until currLesson's readTopicAndDiscount method returns false:
Assign currLesson with a new Lesson object.
Use currLesson's readTopicAndDiscount method to read each pair of inputs, string topic and character discount.
If currLesson's readTopicAndDiscount method returns true, append currLesson to ArrayList lessonList.
Ex: If the input is Culture Y Sports Y Finance N Health Y stop, then the output is:
Lesson: Culture, Discount: Y Lesson: Sports, Discount: Y Lesson: Finance, Discount: N Lesson: Health, Discount: Y
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
