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

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 14:10, aliceohern
The y form of iron is known as: a) ferrite b) cementite c) perlite d) austenite
Answers: 3
image
Engineering, 04.07.2019 18:10, DestyHilBan1183
Adouble-strand no. 60 roller chain is used to transmit power between a 13-tooth driving sprocket rotating at 300 rev/min and a 52-tooth driven sprocket. a) what is the allowable horsepower of this drive? b) estimate the center-to-center distance if the chain length is 82 pitches. c) estimate the torque and bending force on the driving shaft by the chain if the actual horsepower transmitted is 30 percent less than the corrected (allowable) power.
Answers: 3
image
Engineering, 04.07.2019 18:10, Fahaddie
The thermal expansion or contraction of a given metal is a function of the f a)-density b)-initial temperature c)- temperature difference d)- linear coefficient of thermal expansion e)- final temperature f)- original length
Answers: 2
image
Engineering, 04.07.2019 18:10, Candi9697
A-mn has a cubic structure with a0 0.8931 nm and a density of 7.47 g/cm3. b-mn has a different cubic structure, with a0 0.6326 nm and a density of 7.26 g/cm3. the atomic weight of manganese is 54.938 g/mol and the atomic radius is 0.112 nm. determine the percent volume change that would occur if a-mn transforms to b-mn.
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 in other subjects:

Konu
Mathematics, 19.11.2019 19:31