Using Java, write a program that contains an array. The array will contain the titles of your favorite books, games, shows, or movies. You may make it as large as you desire, but only enter the titles through user input.
Sample output: “Dragon Wing”, “Doom Patrol”, “Pokemon”, “Star Wars”
NOTE: Include step-by-step instructions in hidden notes.
import java.util.Scanner; public class PrintMovies { public static void main(String[] args) { Scanner in = new Scanner(System.in); String[] movies = new String[5]; for (int i = 0; i < movies.length; i++) { System.out.println("Enter a movie name: "); movies[i] = in.nextLine(); } System.out.println("Your favorite movies are: "); for (int i = 0; i < movies.length; i++) { System.out.print(movies[i]); if (i != movies.length-1) { System.out.print(", "); } } System.out.println(); } }
Using Java, write a program that contains an array. The array will contain the titles of...
In JAVA write a program that contains an array containing 10 integers (1 to 10). user insert an integer from (1 to 10) , method is library sort or gapped insertion sort that will each sort the array and print it out to the console.
In this labwork, you are expected to write java program that assigns ratings to the movies (1-5). You are given the main class of the program(See Lectures). You supposed to write two classes that works with main class. Movie Class has two attributes: title(String) . rating(int) Reviewer Class has one class variable (array of movies) and three methods: Setmovies: Allow the reviewer's movies to be set . . . rateMovie: Let the reviewer rate one of the movies. pickFavorite: pick...
Write a JAVA program that declares and initializes an array with the following numbers: 10, 89, 50, 24, 60, 1, 15. Then ask the user for a number and check if the array contains that number. If it does, return a message to the user (print to screen) that says
Please complete this code for java Lab Write a program as follows: Create an array with 10 elements. The array should contain numbers generated randomly between 1 and 100 Ask the user to enter any number - Search the array to see if the user entered number is in the array If the user-entered number is in the array, print a 'match found' message. Also print at which index the match was found, else print a 'match not found' message...
Write a Java program that: 1. Decide on a list of n favorites (songs, bands, movies, video games, etc.) (between 5 and 10 favorites is fine). 2. Write a program that lists the n favorites but with a small twist. 3. Read in a file of n favorites (sample file in the Resources/Sample File area)...Please make your own. 4. Print a list of all n favorites to the user (so they know what is coming) 5. Ask if the user...
Write a Java program that will create an array of Strings with 25 elements. Input Strings from the user and store them in the array until either the user enters “quit” or the array is full. HINT: the sentinel value is “quit” all lowercase. “Quit” or “QUIT” should not stop the loop. HINT: you have to use the equals method (not ==) when you are comparing two Strings. After the input is complete, print the Strings that the user entered...
Problem 1: Dynamic Grocery Array Using Java to write a program that prompts the user to enter an item’s name for each position in the array. The program then prints uses a loop to output the array. Example 1: Banana 2: Orange 3: Milk 4: Carrot 5: Chips Banana, Orange, Milk, Carrot, Chips Problem 2: Print Characters in String Array Declare a string array of size 5. Prompt the user enters five strings that are stored in the array....
in java please Write a program that contains an array with all of your friends' first names. Enter the values in any manner and order you choose (I recommend favorites first). Now take that array and sort it alphabetically so that names that start with ‘A' c me first. Look to see if you have any duplicates and if you find any, print out their names. You may use a binary search to determine this. 2. Sample output: Input list...
I need to write a program in java using two array lists. I need to program to prompt the user to enter a day of the week and return an output of a predetermined temperature for the day they selected. I also need the program the output the average of daily temperatures across the week if the user inputs "week". So basically if i set the temperatures to something arbitrary i.e.: Monday = 50 Tuesday = 55 Wednesday = 52...