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, 03.07.2019 23:20
Two technicians are discussing the intake air temperature (iat) sensor. technician a says that the computer uses the iat sensor as a backup to the engine coolant temperature (ect) sensor. technician b says that the powertrain control module (pcm) will subtract the calculated amount of fuel if the air measures hot. who is correct
Answers: 3
question
Engineering, 04.07.2019 16:10
An electrical motor raises a 50kg load at a construct velencity .calculate the power of the motor, if it takes 40sec to raise the load through a height of 24m(take g =9.8n/g)
Answers: 2
question
Engineering, 04.07.2019 18:10
Steel is coated with a thin layer of ceramic to protect against corrosion. what do you expect to happen to the coating when the temperature of the steel is increased significantly? explain.
Answers: 1
question
Engineering, 04.07.2019 18:10
Burgers vector is generally parallel to the dislocation line. a)-true b)-false
Answers: 2
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
Computers and Technology, 25.07.2019 11:00
question
Social Studies, 25.07.2019 11:00