2023 Use the Scanner class to accept input from the user Prompt the | Assignment Collections
Computer Science 2023 Use the Scanner class to accept input from the user.
2023 Use the Scanner class to accept input from the user Prompt the | Assignment Collections
- – Use the Scanner class to accept input from the user.
- Prompt the user for their first name, last name, and age each individually.
- Use string concatenation to obtain the user’s full name.
- Compare the length of the first and last name and if they are the same print:
– “Hello First Last”
– “Your first and last name have both n letters”
– where First and Last are the first name and last name, and n is the length of these names.
- – If the first and last name are of different size, print:
“Hello First Last”
“ The length of your first name is: n”
“ The length of your last name is: m”
– where First and Last are the first name and last name, and n and m are the lengths of these names.
- – Create a loop to print a table with all the characters in the user’s full name and their corresponding ASCII value. You may use the charAt() method of the String class to identify each of the characters in the full name and type cast them as int to obtain their ASCII value (see example).
- – Print out the user’s age with the format shown in the example below.
- Print out the year the user was born with the format shown in the example below. This year is obtained by subtracting the age from the current year.
- Using increment, increase the age by one and create the output shown in the example below.
- Using compound assignment operators, increase the age by 4 more and create the output shown in the example below.
- Do not forget to use comments to describe your program and variables. Also do not forget to indent it properly.
We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.