subject
Engineering, 18.11.2019 18:31 alyssamaize

In this exercise, you will create an arraylist and use some of its methods. slide 16 in lecture 9b will be for this question.

write a program that does the following:

creates an arraylist of strings to store the shows. the arraylist will initially be empty.
prompts the user for the number of shows they plan to watch this week. store this value in an int variable.
uses a for loop to update the arraylist
use the int variable that stores the number of shows as the limit for the loop. (i. e. if the user indicates that they’d like to watch 5 shows the loop should run 5 times.)
the loop should prompt the user for the show names and store that in a local string variable.
the loop should use the add method from the arraylist class(with the local variable as an argument) to update the arraylist.
remember, you should accommodate spaces in your show names, and use the appropriate string methods to read them. look out for any instances where the tv show cannot be inputted (due to the use of next() vs. nextline() methods).
let’s presume some time has passed. in your program, ask the user if they’ve caught up to any shows.
create a string variable to store the response. it should not be the same variable as the one that stores the shows!
create a while loop that does the following:
while the response is yes, prompt the user to enter the show that they’ve caught up on.
use the contains method from the arraylist class to see if the show is on the list
if the contains method is equal to true, use the remove method from the arraylist class to remove the show
else display a message that the show entered is not on the list
prompt the user for any more caught up shows (to get an update for the response
the loop should only repeat if the response is yes.
display the content of the updated arraylist without using a for loop

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 03:10
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
question
Engineering, 04.07.2019 18:10
Ajournal bearing has a journal diameter of 3.250 in with a unilateral tolerance of 20.003 in. the bushing bore has a diameter of 3.256 in and a unilateral tolerance of 0.004 in. the bushing is 2.8 in long and supports a 700-lbf load. the journal speed is 900 rev/min. find the minimum oil film thickness and the maximum film pressure for both sae 20 and sae 20w-30 lubricants, for the tightest assembly if the operating film temperature is 160°f. a computer code is appropriate for solving this problem.
Answers: 3
question
Engineering, 04.07.2019 18:10
Draw the engineering stress-strain curve for (a) bcc; (b) fcc metals and mark important points.
Answers: 1
question
Engineering, 04.07.2019 18:10
Which of the following ziegler nichols tuning methods the response of the controller to a step input should exhibit an s-shaped curve? a)-open loop mode b)-closed loop mode c)-both modes (open & closed) d)-none of the modes (open & closed)
Answers: 3
You know the right answer?
In this exercise, you will create an arraylist and use some of its methods. slide 16 in lecture 9b w...
Questions
question
Chemistry, 26.03.2021 18:10
question
Mathematics, 26.03.2021 18:10
Questions on the website: 13722359