Question: Please don't change the code that is already given! import java.util.ArrayList; public class VideoSystem { Scanner scnr = new Scanner ( System . in )
Please don't change the code that is already given! import java.util.ArrayList;
public class VideoSystem Scanner scnr new ScannerSystemin; inventory.inputVideosscnr;
Write the inputVideos method in the Inventory class. Within inputVideos use scnr to read pairs of inputs, string currTopic and character currDiscount, until "end" is read from input. Create each Video object with currTopic and currDiscount as arguments and append each object to ArrayList videoList. import java.util.ArrayList;
public class Inventory Your code goes here Video currVideo; for i ; i videoList.size; i currVideo.print;
private String topic;public void setTopicAndDiscountString newTopic, char newDiscount discount newDiscount;public void print
Ex: If the input is Cooking Y Science N Agriculture Y Culture Y end, then the output is:
Video: Cooking, Discount: Y
Video: Science, Discount: N
Video: Agriculture, Discount: Y
Video: Culture, 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
