Question: Assume a properly formatted program- What prints if the users enter Bill when the following code is run? Scanner keyboard = new Scanner(System.in); System.out.println(Enter You



Assume a properly formatted program- What prints if the users enter Bill when the following code is run? Scanner keyboard = new Scanner(System.in); System.out.println("Enter You Name"); String name = keyboard.nextLine(); int time = 4; if (name.equals("Bill") && time > 5) { System.out.println("Hi Fred welcome back"); } Hi Fred welcome back Nothing Prints o Hi Bill welcome back Question 9 1 pts Assume a properly formatted program- What prints if the users enter Fred when the following code is run? Scanner keyboard = new Scanner(System.in); System.out.println("Enter You Name"); String name = keyboard.nextLine(); int time = 3; if (name.equals("Fred") && time > 5) { System.out.println("Hi Fred welcome back"); } You are not fred Nothing Prints Assume a properly formatted program- What prints if the users enter Bill when the following code is run? Scanner keyboard = new Scanner(System.in); System.out.println("Enter You Name"); String name = keyboard.nextLine(); int time = 6; if (name.equals("Fred") || time > 5) { System.out.println("Hi Fred welcome back"); } o Hi Fred welcome back You are not fred o Nothing Prints Question 7 1 pts Assume a properly formatted program- What prints if the users enter 15 when the following code is run? bool ratedPG13 = true; Scanner keyboard = new Scanner(System.in); System.out.println("Enter the Sale tax percent as an integer"); int age = keyboard.nextInt(); if (age > 12 && ratedPG13) { System.out.println("You can see the movie"); } You can not see the movie Nothing Prints Assume a properly formatted program- What prints if the users enter Bill when the following code is run? Scanner keyboard = new Scanner(System.in); System.out.println("Enter You Name"); String name = keyboard.nextLine(); int time = 6; if (name.equals("Fred") && time > 5) { System.out.println("Hi Fred welcome back"); } Nothing Prints Hi Fred welcome back You are not fred Question 5 1 pts Assume a properly formatted program- What prints when the following code is run and if the value stored for handValue is 21. boolean hasJack = true; if (handValue != 21 && hasJack) { System.out.println("This is not BlackJack"); } This is not Blackjack Nothing Prints This is BlackJack
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
