Assignment: Check the Sample run first, then carefully read the instructions and write aprogram that prompts the user for first name, last name, then secret number. The output willgenerate a default email address and a default password. 1. The main method will do the following:• Asks the user for first name, last name, and secret number using Scanner. (first lettercan be in upper case)• Call defaultInfo(String, String) method to PRINT default Kean email address.• Call defaultInfo(String, int) method to PRINT default Kean password.• Note: You are using overloaded methods (i.e., same method name with differentparameter lists) 2. Write an overloaded method, defaultInfo, which does the following:• public static void defaultInfo(String firstName, String lastName) [Note:you can use your own variable name]‒ print default email address all in low caps: concatenate first letter offirstName, full lastName, and @gmail.com. [Hint: string.charAt(index),string.toLowerCase()]• public static void defaultInfo(String firstName, int secret) [Note: Youcan use your own variable name]‒ print default password all in low caps: concatenate the full firstName in reverseorder and the secret number). [Hint: use a loop, string.length(),string.charAt(index), string.toLowerCase()] Two Sample Runs:Enter first name: DaehanEnter last name: KwakEnter secret number: 2018Kean email: dkwak@gmail.comKean password: nahead2018 Enter first name: MichealEnter last name: JordanEnter secret number: 23Kean email: mjordan@gmail.comKean password: laehcim23 Useful Hints• Notes on toLowerCase (from ppt slide Ch4-2 and Ch4-3)s.toLowerCase() Returns a new string with all letters in string s lowercase.Character.toLowerCase(ch) Returns the lowercase of the specified character ch. • String Concatenation (from ppt slide Ch4-3)String s1 = "Mississippi";String s2 = "River";String s3 = s1.concat(s2);orString s3 = s1 + s2;System.out.println( s3 );          //will both print: MississippiRiver // Three strings are concatenatedString message = "Welcome " + "to " + "Java"; // String Chapter is concatenated with number 2String s = "Chapter" + 2; // s becomes Chapter2 // String Supplement is concatenated with character BString s1 = "Supplement" + 'B'; // s1 becomes SupplementB • String Concatenation (from ppt slide Ch4-3)Recall that index starts from 0 up to (endIndex – 1)

Question

Assignment: Check the Sample run first, then carefully read the instructions and write a
program that prompts the user for first name, last name, then secret number. The output will
generate a default email address and a default password.

1. The main method will do the following:
• Asks the user for first name, last name, and secret number using Scanner. (first letter
can be in upper case)
• Call defaultInfo(String, String) method to PRINT default Kean email address.
• Call defaultInfo(String, int) method to PRINT default Kean password.
• Note: You are using overloaded methods (i.e., same method name with different
parameter lists)

2. Write an overloaded method, defaultInfo, which does the following:
• public static void defaultInfo(String firstName, String lastName) [Note:
you can use your own variable name]
‒ print default email address all in low caps: concatenate first letter of
firstName, full lastName, and @gmail.com. [Hint: string.charAt(index),
string.toLowerCase()]
• public static void defaultInfo(String firstName, int secret) [Note: You
can use your own variable name]
‒ print default password all in low caps: concatenate the full firstName in reverse
order and the secret number). [Hint: use a loop, string.length(),
string.charAt(index), string.toLowerCase()]

Two Sample Runs:
Enter first name: Daehan
Enter last name: Kwak
Enter secret number: 2018
Kean email: dkwak@gmail.com
Kean password: nahead2018

Enter first name: Micheal
Enter last name: Jordan
Enter secret number: 23
Kean email: mjordan@gmail.com
Kean password: laehcim23

Useful Hints
• Notes on toLowerCase (from ppt slide Ch4-2 and Ch4-3)
s.toLowerCase() Returns a new string with all letters in string s lowercase.
Character.toLowerCase(ch) Returns the lowercase of the specified character ch.

• String Concatenation (from ppt slide Ch4-3)
String s1 = "Mississippi";
String s2 = "River";
String s3 = s1.concat(s2);
or
String s3 = s1 + s2;
System.out.println( s3 );          //will both print: MississippiRiver

// Three strings are concatenated
String message = "Welcome " + "to " + "Java";

// String Chapter is concatenated with number 2
String s = "Chapter" + 2; // s becomes Chapter2

// String Supplement is concatenated with character B
String s1 = "Supplement" + 'B'; // s1 becomes SupplementB

• String Concatenation (from ppt slide Ch4-3)
Recall that index starts from 0 up to (endIndex – 1)

 

Expert Answer

Want to see the step-by-step answer?

See Answer

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

See Answer
*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: Use Draw.IO https://www.draw.io/ to create an ERD based on the following information:• The RDBMS wou...

A: Below is the design of the Employees entity:- 

Q: Find dfa’s that accept the following languages: (a) L (aa∗ + aba∗b∗). (b) L (ab (a + ab)∗ (a + aa)).

A: We will solve part (a) L (aa∗ + aba∗b∗) first. To get the DFA, we need to draw the NFA of the given ...

Q: How can I use a logic gate to test if two numbers are equal?

A: The “Exclusive-NOR” gate is a combination of the Exclusive-OR gate and the NOT gate.

Q: Prove that the following languages are not regular: (b) L = {anblak : k ≠ n + l}. (c) L = {anblak : ...

A: In the given question, multiple parts are there and we will solve only first three parts as no parti...

Q: Thank you!C++ please

A: First we'll create a LinkedList class.Below is the code for the LinkedList class:-class LinkedList{p...

Q: Find regular grammars for the following languages on {a, b}: L = {w : na (w) and nb (w) are both eve...

A: Regular grammar for the language L = {W: na (w) and nb (w) are both even} is as follows:

Q: Register A holds the 8-bit binary 11011001. Determine the B operand and the logic microoperation to ...

A: Selective Complement: this operations complement the bits in register A for which the corresponding ...

Q: You are not required to execute the queries. However, your syntax must by accurate.You must give at ...

A: Since the full table structure is not given we make suitable assumptions to write the query:For ques...

Q: Describe, in English, the language defined by the following grammar in BNF (start symbol is ):

A: Solution:The given grammar is,<S> :: = <A> |<B><C> :: = a | c<A> :: = ...