Write a program that asks a user to enter their name. Use 'String' variable to store the input. The program should display the name of the user:
Added by Lu-S F.
Close
Step 1
First, we need to import the Scanner class from the java.util package to read user input. Add the following line at the beginning of your code: ```java import java.util.Scanner; ``` Show more…
Show all steps
Your feedback will help us improve your experience
Md.Daniyal Arshad and 100 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a program that allows the user to enter his or her name. The program should output a username for entry into a website. The user should be prompted to enter a first name, middle initial, and last name. If the user doesn't have a middle initial, the entry should be "none." In this case, the output will be a username that concatenates the first and last names with a dot between them. If the user has a middle initial, the output username should be in the form first.middle_initial.last. For example, a user whose name is Harold Nguyen would have Harold.Nguyen for his username and a user whose name is Maria Anna Lopez would have Maria.A.Lopez for a username.
Shelayah R.
1. Write a Java program to print your name on screen.
Haricharan G.
'Part (2) Write Java application that asks the user to enter the employee name, pay rate normal hours worked, and extra hours worked_ Create an object of type Employee class you defined in Part (1) and set its values according to the input data_ Use it to calculate the pay amount and print the data'
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD