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?

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!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Java

Related Computer Science Q&A

Find answers to questions asked by students like you.

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> :: = ...

Q: List the octal and hexadecimal numbers from 1410 to 3210. Using A and B for the last two digits, lis...

A: Answer:Listing octal values from 1410 to 3210:Divide 14 by 8 (octal number) giving 1 remainder 61 is...

Q: This table is in 1NF. What does the table look like in 3NF? This is about Normalization.

A: First to make the table clears 3NF we need to understand what is Normal form.* Basically normal form...

Q: Do you think technologies like Big Data and Predictive Analytics in Marketing would have worked 10-1...

A: The technologies like Big Data would not have worked 10-15 years back as due to lack of large datase...

Q: Normalization               Repair the ER Diagrams into at least 1nf, 2nf and 3nf Give explanations...

A: Hi due to lack of adequate information we are unable to provide any solution. Please provide us more...

Q: Use the worksheets to show, one path augmentation at a time, how to use the Ford-Fulkerson Algorithm...

A: For solving your problem first of all we define Ford-Fulkerson Algorithm.Ford-Fulkerson Algorithm fo...

Q: 1) The UsingMethod class consists of a main method and a method called xMethod. What will the code p...

A: Hey, since there are multiple questions posted, we will answer first question. If you want any speci...

Q: Design a program that prompts user enters user name and password. Until user entered user name as "F...

A: Note: The given program is compiled and executed in "NetBeans IDE"

Q: Based on the code that I already have, please help me complete it. I am attempting to use 2 function...

A: Corrections in Program:Add a closing bracket after return statement of main.Remove the parameters fr...

Q: how to write a function in python 3 using for loop that counts how many times a consonant (either lo...

A: Note: The given program is compiled and executed in "repl.it" online compiler.

Q: 21,22,23

A: An image contains white, black or different shades of grey from black (maximum gray) to white (minim...

Q: Write a PL/SQL block to accept a date from the user and print the day and the date as shown below. U...

A: Solution:Given data,The PL/SQL code read the user input of date and display the day and the date in ...

Q: This question is for Python. Thank you!

A: The algorithm of the file would be as below:Receive the inputs as a series of input commandsConcaten...

Q: Find an nfa that accepts the complement from L (ab∗aa + bba∗ab)?

A: Solution:The following graph indicates the NFA (Non-deterministic finite automata) is given below:M ...

Q: Assume the following declarations and initializations (MIN, MAX, num) are made just before each sub-...

A: Answer: Algorithm:The program has the following algorithm:The class name is “Main” and in the main m...

Q: (The Fan class) Design a class named Fan to represent a fan. The class contains:■ Three constants na...

A: Java program to create Fan class is as follows:

Q: how is macro work in word 2016

A: At first we need to enable the developer Tab if it's not enabled previously.Next, we need to click t...

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

A: Hey, since there are multiple sub-part questions posted, we will answer first three questions. If yo...

Q: Use eclipse for these methods

A: Solution:Given data,The java code to display the output for method calls using the method overloadin...

Q: Consider the languages below. For each, make a conjecture whether or not it is regular. Then prove y...

A: The given language L = {anbl : n/l is an integer} is not regular language because a DFA cannot be co...

Q: CHALLENGE 1.24: Read multiple user inputs. ACTIVITY Write two scnr.nextint statements to get input v...

A: Given below is the program to get input values for month and year and write the output value as a mo...

Q: Find a pda that accepts the language L={anb2n :n≥0}.L={anb2n :n≥0}.

A: Pushdown Automata (PDA):In PDA, we can store one alphabet of language because PDA has only one stack...

Q: Eliminate all λ-productions from S → AaB|aaB, A → λ, B → bbA|λ.

A: A procedure of removing all λ productions is as follows:

Q: Consider a 32-bit hexadecimal number stored in memory as follows: Address Value 100 2A 101...

A: Answer:In Little Endian the order is reversed. So the binary representation of reversed order is as ...

Q: create a file in c++. In this lab, you will replace the existing functions with more flexible ones, ...

A: Program Instructions:Define the necessary constants and header files.Use displayMessage() function t...

Q: Develop the ‘Shape’ application such that: ‘Rectangle’, ‘Ellipse’, and ‘Triangle’ classes inherit f...

A: Program plan:Define a class named “Shape”.Define a default constructor to print constructor invoked ...

Q: This is a Python question. How do I get the following code to create a numerical list of guest names...

A: We need to convert the guest_name variable as a Python list of 50 elements and initialize each eleme...

Q: Function #2: largest Parameters: num1 - a floating point number being compared against num2 and num3...

A: Solution:largest() function:#Define the functiondef largest(num1, num2, num3):    #Check if "num1" i...

Q: Function Name: leapYear Parameters: year – an nonnegative integer representing the year Test Cases: ...

A: Click to see the answer

Q: 11,12,13

A: Two main advantages of storing data digitally rather than in analog format are:Data stored in digita...

Q: how to write a function that takes an integer n and prints all of the integers between 1 and n which...

A: Since no programming language is specified we choose python as it is one of most popular programming...

Q: In Eclipse write a while loop which prints the even numbers from 20 to 30 (including 30).

A: Program Instructions:Create a class named PrintEven, and initialize a variable i to 20 in the main m...

Q: The symmetric difference of two sets S1 and S2 is defined as S1 ⊝ S2 = {x : x ∈ S1 or x ∈ S2, but x ...

A: Solution:Given that,The symmetric difference between two sets such as “S1” and “S2” can be expressed...

Q: 11.7: Customer AccountsWrite a program that uses a structure to store the following data about a cus...

A: Program plan:Include the required header files.Define the structure “customerAccount”Declare the req...

Q: the book is "First Course on Fuzzy Theory and Applications"

A: The formula for calculating the Hamming distance (d) of fuzzy set:

Q: Construct an unambiguous grammar equivalent to the grammar in  S→AB|aaaB, A→a|Aa, B→b.

A: Solution: Construct an unambiguous grammar to grammar.Given that,S -> AB|aaaBA -> a|AaB -> ...

Q: Read in 5 letters from the keyboard, reverse the order of the second and next to last letters, and p...

A: Program to reading 5 letters from the keyboards and reversing the order of the second and next to la...

Q: how can I write a statement in C++ that would print last name, followed by a comma, followed by firs...

A: Given below is the C++ program to print a statement with last name, followed by comma, followed by f...

Q: Find a regular grammar that generates the language L (aa∗ (ab + a)∗).

A: Solution: Given input,L(aa*(ab+a)*)Determine the regular grammar for L(aa*(ab+a)*):

Q: If you are reading a flat file, with minimal information regarding business rules and constraints. H...

A: Solution:Even though the file contains minimal information about business rules and constraints, the...

Q: 1. Write a complete Java program that prompts user for the number of floors in a hotel. Validate the...

A: Note: The given java program has been compiled and executed in "repl.it" online complier.

Q: This is for Python code.

A: Solution:#Define functiondef twoscomp(n):       #Declare empty variable    comp = ""       #Loop exe...