1 import java.util.Scanner; 2 class Question1 { 3 public static void main(String[] args) { 4 5 6 7 8 9 10 11 12 13} } Scanner keyboard = new Scanner(System.in); System.out.print("Enter your name: "); String name keyboard.nextLine(); System.out.print("Enter number of children you have: "); String numChildren = keyboard.nextLine(); System.out.println("Hi" + name); System.out.println("If you adopt another child, you would have " + numChildren + 1 + " children"); Consider the following sample run showing the user interaction with this program: $java Question1 Enter your name: Jane Doe Enter number of children you have: 2 What will the first line of output after the prompts for this program be? A. Hi name B. HiJane Doe OC. Hi Jane Doe
1 import java.util.Scanner; 2 class Question1 { 3 public static void main(String[] args) { 4 5 6 7 8 9 10 11 12 13} } Scanner keyboard = new Scanner(System.in); System.out.print("Enter your name: "); String name keyboard.nextLine(); System.out.print("Enter number of children you have: "); String numChildren = keyboard.nextLine(); System.out.println("Hi" + name); System.out.println("If you adopt another child, you would have " + numChildren + 1 + " children"); Consider the following sample run showing the user interaction with this program: $java Question1 Enter your name: Jane Doe Enter number of children you have: 2 What will the first line of output after the prompts for this program be? A. Hi name B. HiJane Doe OC. Hi Jane Doe
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
Step 1
The Scanner class is used to get user input and it is found in the java.util package.
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education