1. The main method will do the following:· Asks the user for first name, last name, and secret number using Scanner. (first letterCall defaultInfo (String, String) method to PRINT default Kean email addressNote: You are using overloaded methods (i.e., same method name with differentcan be in upper case)Call defaultInfo (String, int) method to PRINT default Kean passwordparameter 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 Kean email address all in low caps: concatenate first letter offirstName, full lastName, and @kean.edu. [Hint: string.charAt(index),string.toLowerCase)1public 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.lengthO,string.charAt(index), string.toLowerCase()]3. More useful hints on the next page.Two Sample Runs:Enter first name: DaehanEnter last name: KwakEnter secret number: 2018Kean email: dkwak@kean.eduKean password: nahead2018Enter first name:MichealEnter last name: JordanEnter secret number: 23Kean email: miordan@kean.eduKean password: laehcim23

Question
Asked Apr 25, 2019
455 views

Write a program in Eclipse that prompts the user for first name, last name, then secret number. The output will generate a default Kean 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
Call defaultInfo (String, String) method to PRINT default Kean email address
Note: You are using overloaded methods (i.e., same method name with different
can be in upper case)
Call defaultInfo (String, int) method to PRINT default Kean password
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 Kean email address all in low caps: concatenate first letter of
firstName, full lastName, and @kean.edu. [Hint: string.charAt(index),
string.toLowerCase)1
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.lengthO,
string.charAt(index), string.toLowerCase()]
3. More useful hints on the next page.
Two Sample Runs:
Enter first name: Daehan
Enter last name: Kwak
Enter secret number: 2018
Kean email: dkwak@kean.edu
Kean password: nahead2018
Enter first name:Micheal
Enter last name: Jordan
Enter secret number: 23
Kean email: miordan@kean.edu
Kean password: laehcim23
help_outline

Image Transcriptionclose

1. The main method will do the following: · Asks the user for first name, last name, and secret number using Scanner. (first letter Call defaultInfo (String, String) method to PRINT default Kean email address Note: You are using overloaded methods (i.e., same method name with different can be in upper case) Call defaultInfo (String, int) method to PRINT default Kean password 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 Kean email address all in low caps: concatenate first letter of firstName, full lastName, and @kean.edu. [Hint: string.charAt(index), string.toLowerCase)1 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.lengthO, string.charAt(index), string.toLowerCase()] 3. More useful hints on the next page. Two Sample Runs: Enter first name: Daehan Enter last name: Kwak Enter secret number: 2018 Kean email: dkwak@kean.edu Kean password: nahead2018 Enter first name:Micheal Enter last name: Jordan Enter secret number: 23 Kean email: miordan@kean.edu Kean password: laehcim23

fullscreen
check_circle

Expert Answer

Step 1

Program plan:

  • Include the required header file.
  • Define the class “Main”.
    • Define the “defaultInfo” method with the arguments first name and last name.
      • Declare the variable “e” and concatenate the first letter in first name, the last name, and “@kean.edu” to the string.
      • Display the email id.
    • Define the “defaultInfo” method with the arguments first name and secret number.
      • Declare the variable.
      • Reverse the first name and store the result in “p” variable.
      • Concatenate the “p” and secret number.
      • Display the password.
    • Define the main method.
      • Get the first name, last name, and secret number from the user.
      • Call the method “defaultInfo” with the arguments first and last names.
      • Call the method “defaultInfo” with the arguments first name and secret number.
Step 2

Program:

//include required header file

import java.util.Scanner;

 

//definition of "Main" class

public class Main {

 

     //definition of "defaultInfo" method

      public static void defaultInfo(String firstName, String lastName) {

 

            //declare and append the first and last name

            String e = firstName.toLowerCase().charAt(0)

 

                       + lastName.toLowerCase() + "@kean.edu";

 

//display the email id

            System.out.println("Kean email: " + e);

 

      }

 

      //definition of "defaultInfo" method

      public static void defaultInfo(String firstName, int secret) {

 

//declare the variable

            String p = "";

 

           //check the condition

            for (int i = firstName.length() - 1; i >= 0; i--) {

 

//generate the password

                  p += firstName.charAt(i);

 

            }

 

            //converting to lowercase and appending secret number

            p = p.toLowerCase() + secret;

 

            //display the password

            System.out.println("Kean password: " + p);

 

      }

      //definition of main method

 

      public static void main(String[] args) {

 

            //create an object for scanner class

            Scanner x = new Scanner(System.in);

 

//get the first name from the user

            System.out.print("Enter first name: ");

            String first = x.nextLine();

 

//get the last name from the user

            System.out.print("Enter last name: ");

            String last = x.nextLine();

 

//get the secret number from the user

            System.out.print("Enter secret number: ");

            int secret = x.nextInt();

 

  //call the methods

            defaultInfo(first, last);

            defaultInfo(first, secret);

 

      }

 

}

Step 3

Program Screenshot 1:

&nbs...

fullscreen

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.

Related Computer Science Q&A

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

Q: create a python program that will ask users to input four different manufacturers of cars(e.g Ford, ...

A: Create a class Car and define _init_ () function which will initialize the value of variables manufa...

question_answer

Q: Write a class AnalyzeNumbers which asks the user to enter the number of inputs andstores them in an ...

A: Program plan:Define the class “AnalyzeNumbers”.Define the “main()” method.Create object for “Scanner...

question_answer

Q: How can I create a decoder and a multiplexer in a circuit? The decoder has a 3 bit select input and ...

A: A decoder is a circuit which has n inputs and 2n outputs. So if there are 3 inputs to a decoder it w...

question_answer

Q: Choose an organization that you interact with regularly and list as many different “systems” (comput...

A: Let’s break the system of university part by part. For example, it may include course management and...

question_answer

Q: How to write a function in python where it takes a list of string s. Where s= ["hello","lazyness","p...

A: The program has the following algorithm:Intitialize the counter counting string list position number...

question_answer

Q: What is a solid state disk?

A: Solid state disk drive or solid state drive (SSD) is a non-volatile that stores (or persists) data i...

question_answer

Q: 1.6 Compute the scalar cardinality and the fuzzy cardinality for each of thefollowing fuzzy set.

A: The scalar cardinality of a fuzzy set is calculated using the formula:

question_answer

Q: 5-9) (Find the two highest scores) Write a program that prompts the user to enter the number of stud...

A: Program that prompts the user to enter the number of students and each student’s name and score, and...

question_answer

Q: How do I read a sequence of values in a file into a arraylist in a method? It's in java progarmming.

A: We need to use Scanner calss. In which java.util package used for obtaining the input of the primiti...