Ask the user to enter three of their favourite television shows. Once they have entered there shows, display the results. Use an array to store the three television shows
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String [] television = new String[3];
System.out.println("Enter the first favourite television show");
television[0] = scan.next();
System.out.println("Enter the first favourite television show");
television[1] = scan.next();
System.out.println("Enter the first favourite television show");
System.out.println("The most like television shows are:: ");
television[2] = scan.next();
for(int i= 0; i<3; i++){
System.out.println(television[i]);
}
}
}
Comments
Leave a comment