Question
Part A) Basic imports, 2 points Create a new Java Project. Name it name_Lab2 Create a Java class file in that Project At the top
Part A) Basic imports, 2 points
Create a new Java Project. Name it name_Lab2
Create a Java class file in that Project
At the top of your new class file, be sure to import java.util.Scanner. This is necessary for the input/output in this lab!
Part B) Basic Input Practice, 5 points
For this part of the lab, create a new Scanner object. Then, print to the console asking for the users name. The Scanner should take the users name as input. Then, display the users name back to them with a message: something like Your name is NAME_HERE is fine.
Part C) Basic String Manipulation, 8 points
Print out the following information in the console
The length of the users name
The first and last characters of the name
The 6th character in the name (is this index 6? Or is it index 5?)
Print the name IN ALL UPPERCASE LETTERS, BECAUSE YOU JUST ACTIVATED CRUISE CONTROL FOR COOL!
Part D) Print Math, 5 points
Ask the user for their favorite number. Store this number in an int or a double variable. Then, perform the equation (Name_length + 2 * Favorite_Number) and store it in a variable. Finally, print the result of the equation to the console.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started