Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

how This assignment will ask you to write a program that foe uses on the effecti

ID: 670134 • Letter: H

Question

how This assignment will ask you to write a program that foe uses on the effective use o f various classes provide by Java Be suite to read this entire assignment through carefully and do everything that is asked You are going to write a program. AccountNamceXX Java, where 'XX' are your initials, that generates a unique account name for a customer Because a customer might have more than one accounts (say personal and business) account names will he constructed using multiple pieces o f information including a random factor (We will not simply use random numbers so that if an account manager is looking at several accounts they can more easily remember which accounts go with which person ) lie sure to write your code to support the full range of different reasonable responses from the user, while following the described restrictions In addition, be sure you arc following all relevant style guidelines for this assignment, this includes the requirement that no if statements or loops the used You will be generating an account name based on information the user pros ides To start, prompt the user for in the first name and their zip code Read these in and store them in variables with appropriate types The first name should be a single token, it the user entry is multiple tokens only consider the first one as the first name and discard the remainder An interaction with the user including these prompts will look as follows You may wish to tempo arils add some output statements that just repeat I he name and /ip code hack lo test that so u ate leading the input correctly. Enter your first name Alice Enter your tip cod : 94102 You w i ll new start the processing to generate an account name first print a line of output to the user starting that processing has started them complete the first step of constructing the account name converting the user name in to all upper case and using that is the user of the account name report this progress to the user.

Explanation / Answer

import java.util.Scanner;


public class AccountNameMR
{
public static void main(String[] args)
{
Random r=new Random();
Scanner s=new Scanner(System.in);
System.out.println("Enter your first name: ");
String name=s.nextLine().split(" ")[0];

System.out.println("Enter your zip code");
int zip=s.nextInt();
System.out.println("Name: "+name);
System.out.println("ZIp: "+zip);
System.out.println("Processing....");
System.out.println(" Formatting name: "+name.toUpperCase());
}
}