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 18:10
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
question
Engineering, 04.07.2019 18:20
What is the heat treatment of metals? what is the benefit of it? why and how it's useful? answer in details, do not write by hand.
Answers: 3
question
Engineering, 04.07.2019 18:20
Find the kinematic pressure of 160kpa. for air, r-287 j/ kg k. and hair al viscosity of air at a temperature of 50°c and an absolute (10 points) (b) find the dynamic viscosity of air at 110 °c. sutherland constant for air is 111k
Answers: 3
question
Engineering, 04.07.2019 18:20
How much power could a wind turbine produce if it had the following specifications? cp = 0.45 -d=1.2kg/m3 d=50m v 5m/s
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
Mathematics, 22.05.2021 02:30
question
Mathematics, 22.05.2021 02:30
question
Mathematics, 22.05.2021 02:30
question
Mathematics, 22.05.2021 02:30
question
Mathematics, 22.05.2021 02:30
Questions on the website: 13722361