Question

Using Java, write a program that contains an array. The array will contain the titles of...

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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
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();
    }
}
Add a comment
Know the answer?
Add Answer to:
Using Java, write a program that contains an array. The array will contain the titles of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT