Question: Repeat the following until currLecture's readDiscountAndTopic ( ) method returns false: import java.util.ArrayList; public class Lectures { Scanner scnr = new Scanner ( System .
Repeat the following until currLecture's readDiscountAndTopic method returns false: import java.util.ArrayList;
public class Lectures Scanner scnr new ScannerSystemin; Lecture currLecture; int i; for i ; i lectureList.size; i currLecture.print; import java.util.ArrayList;
public class Lectures Scanner scnr new ScannerSystemin; Lecture currLecture; int i; for i ; i lectureList.size; i currLecture.print;
public class Lecture private String topic; char newDiscount; if newDiscount Z return false; discount newDiscount; return true;
Assign currLecture with a new Lecture object.
Use currLecture's readDiscountAndTopic method to read each pair of inputs, character discount and string topic.
If currLecture's readDiscountAndTopic method returns true, append currLecture to ArrayList lectureList.
Ex: If the input is Y Jewelry Y Hobbies N Science Y Marketing Z then the output is:
Lecture discount: Y Topic: Jewelry
Lecture discount: Y Topic: Hobbies
Lecture discount: N Topic: Science
Lecture discount: Y Topic: Marketing
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
