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 19:30
When using the ohmmeter function of a digital multimeter, the leads are placed in what position relative to the component being tested? a. parallel b. control c. series d. line
Answers: 3
question
Engineering, 04.07.2019 18:10
Afour cylinder four-stroke in-line engine has a stroke of 160mm, connecting rod length of 150mm, a reciprocating mass of 3kg and its firing order is 1-3-4-2. the spacing between cylinders is 100mm. i. show that the engine is in balance with regard to the primary inertia forces and primary 3. a and secondary inertia couples. li determine the out of balance secondary inertia force ii. propose ways of balancing this out of balance force and discuss the challenges that will arise
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 controllers anticipates the future from the slope of errors over time? a)-proportional b)-on/off c)-integral d)-derivative.
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
History, 20.02.2021 08:20
question
English, 20.02.2021 08:20
question
Business, 20.02.2021 08:20
question
Social Studies, 20.02.2021 08:20
question
Mathematics, 20.02.2021 08:20
question
English, 20.02.2021 08:20
Questions on the website: 13722360