A story about Not TooYoung: NOT TOO YOUNG is NTY. NTY\'s favorite color is red,
ID: 3608681 • Letter: A
Question
A story about Not TooYoung:
NOT TOO YOUNG is NTY.
NTY's favorite color is red, and NotY. is 23.
The lucky number of N. T. Young is77.
importjava.util.Scanner;
public class cc
{
public static void main(String[] args)
{
String fname;
String mname;
String lname;
int age;
int luckyn;
String favo;
Scanner keyboard = newScanner(System.in);
System.out.print("Please enteryour first name here>> ");
fname =keyboard.nextLine();
System.out.print("Please enteryour middle name here>> ");
mname =keyboard.nextLine();
System.out.print("Please enteryour last name here>> ");
lname =keyboard.nextLine();
System.out.print("Please enteryour age here>> ");
age = keyboard.nextInt();
System.out.print("Please enteryour lucky number here>> ");
luckyn =keyboard.nextInt();
keyboard.nextLine();
System.out.print("Please enteryour favorite color here>> ");
favo =keyboard.nextLine();
System.out.println("");
System.out.println("A storyabout " + fname + " " + mname + " " + lname);
System.out.println("");
System.out.println(" " +fname.substring(0,1) + mname.substring(0,1) +
lname.substring(0,1)+ "'s favorite color is " + favo + ", and " +fname.substring(0,2) +
" " + lname.substring(0,1) + ". is " + age);
System.out.println(" The lucky numberof " + fname.substring(0,1) + ". " +mname.substring(0,1)
+ ". " + lname + " is " + luckyn);
Explanation / Answer
dear, u can do this by using toUpperCase and toLowerCase functions thatare present in String class. .i.e String s="HELLO"; s.toLowerCase() will be "hello" Thanks,
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.