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

Here is what I have so far...It is so complex that I know I am missing some thin

ID: 3538183 • Letter: H

Question

Here is what I have so far...It is so complex that I know I am missing some things....


I need a driver class (this is my main) that will start the project using a method to call another class.

Then I will need two additional classes. ...Here is one of the classes that will have several different methods.

public class x

{

static String namet[]=new String[10];

static int amount[]=new int[10];



public static void startProgram(){

//control the flow of program, calling other methods of this class and others as needed.


displayWelcomeMessage();

displayOptions();

}


public static void displayWelcomeMessage()

{

//welcome message explains program, with no return value

System.out.println("Welcome. ........");


}


public static void displayOptions(){

//programand read in an integer for their choice...

//Validify that only a single digit integer and an integer is entered..if not reenter the correct choice.*********

  

Scanner input = new Scanner(System.in);

// String list = "";

System.out.println("Please select a number from the options below");

System.out.println("");

////check for valid data.

while(true){

// Give the user a list of their options

System.out.println("1: Add a name.");

System.out.println("2: Remove a name.");

System.out.println("3: Edit a name.");

System.out.println("4: Remove all names.");

System.out.println("0: Exit the program");

  

// Get the user input

int userChoice = input.nextInt();

  

switch(userChoice){

case 1:

userChoice=addname();

break;

case 2:

userChoice=removename(name);

break;

case 3:

userChoice=editname(name);

break;

case 4:

userChoice=removeAllnames(name);

break;

case 0:

System.out.println("Exiting program.");

System.exit(0);

}

}}

  

public static void addnamet(){

/*add name to list (globally) then have the user add amount

assume 20 amounts that does not exceed 20*/

Scanner input = new Scanner(System.in);


int flag = -1;//flag will be used as an open space indicator

for(int i=0;i<name.length;i++)

{ if(namet[i] == null){//null used to check if field is empty

flag= i;

break;}

}

if(flag == -1)

{System.out.println("You do not have room to add");}

else

{ System.out.println("What is the nam you would like to add");

name[flag]=input.nextLine();

Name name=new Name();//getting the other class

amountArray[flag]=new Name();

  

System.out.println("Enter first amount");

String amount= input.nextLine();

  amount.setValueOne(amount);

  

System.out.println("Enter second amount");

String secamount= input.nextLine();

  amount.setValueTwo(secamount);

  

System.out.println("Enter third amount");

String thirdamount= input.nextLine();

  amount.setValueThree(thirdamount);

  

  

System.out.println("Enter fourth amount");

String fourthamount= input.nextLine();

  amoun.setValueFour(fourthamount);

  

System.out.println("Enter fifth amount");

String fifthamount= input.nextLine();

amount.setValueFive(fifthamount);

  

System.out.println("Enter sixth amount");

String sixthamount= input.nextLine();

  amount.setValueSix(sixthamount);

  

System.out.println("Enter seven amount");

String seventhamount= input.nextLine();

amount.setValueSeven(seventhamount);

  

System.out.println("Enter eighth amount");

String eightamount= input.nextLine();

  amount.setValueEight(eightamount);

  

System.out.println("Enter ninth amount");

String ninthamount= input.nextLine();

  amount.setValueNine(ninthamount);

  

System.out.println("Enter tenth amount");

String tenthamount= input.nextLine();

  amount.setValueTen(tenthamount);


  

  

AmountArray[flag]=amount;//this will store all of the characteristics into the Array...

}

}

public static void removename()

{ /*Prompt the user for name then remove from the array list*/

Scanner input = new Scanner(System.in);

  

for (int i = 0; i < name.length; i++) //I wanted to print the array first so that the user can see the list for index

{System.out.println("Index " + i + " is: " + name[i]);

  

System.out.println(" ");}

  

System.out.println("What index number in the array would you like to remove");

System.out.println(" ");


for (int i=input.nextInt();i<name.length-1;i++)

{

name[i]=name[i+1];

name[i+1]=null;//I set the value to null so I could make sure that the item has been deleted and able to add another

AmountArray[i]=AmountArray[i+1];

AmountArray[i+1]=null;//I set the grade values to null so I could make sure that the items have been deleted

System.out.println(i+" has been successfully deleted.");

System.out.println(" ");

System.out.println("Your list after the deletion");

System.out.println(" ");

for(i=0;i<name.length;i++)

{System.out.println(name[i]);}

}

}

public static void editname()

{

System.out.println("Enter the name to edit.");

editname=input.nextLine();

System.out.println("What would you like to edit on"+editname);

System.out.println("Please enter a number indicating what you would like to edit:");

System.out.println("1 -Value 1"+" "+"2-Value2"+" l"+"3 -Value3"+" "+"4 -Value4"+" l"+

"5 -Value 5"+" "+"6 -Value 6"+" l"+"7 Value 7"+" "+"8 Value 8"+" l"+

"9 -Value 9"+" "+"10 -Value 10"+" l"+"11 -Name"+" "+"12 -Exit");

/*Desired Result: Prompt the user for name then edit the information. asking what they would to edit so that they don%u2019t have to edit everything For example:

* Please enter a number indicating what you would like to edit:

* 1 - Value 1 2 - Value 2

* 3 - Value 3 4 - Value 4

* 5 -Value 5 6 - Value 6

* 7 -Value 7 8 - Value 8

* 9 - Value 9 10 - Value 10

* 11 - Name 12 - Exit

* Data Returned: None..*/

}

  

public static void removeAllNames()

{//Desired Result: Remove all names from the array list.




for (int i=0;i<name.length-1;i++)

{

name[i]=name[[i+1];

namet[i+1]=null;

AmountArray[i]=AmountArray[i+1];

AmountArray[i+1]=null;

System.out.println(i+" has been successfully deleted.");

System.out.println(" ");

System.out.println("Your list after the deletion");

System.out.println(" ");

for(i=0;i<name.length;i++)

{System.out.println(name[i]);}

}

}

  

public static void listAllnames()

{/* Desired Result: List all names and their amounts*/

  

  

for(int i=0;i<student.length;i++){

  

System.out.println(name[i]+" - "+" "+"Value 1: " + amountArray[i].getValueOne() + " " +

"Value 2: " + amountArray[i].getValueTwo() + " " + "Value3: " + amountArray[i].getValueThree()+" "+

"Value 4: " + amountArray[i].getValueFour() +" "+"Value5: " + amountArray[i].getValueFive() +

" "+"Value 6: " + amountArray[i].getValueSix() +" "+"Value 7: " + amountArray[i].getValueSeven() +

" "+"Value 8: " + amountArray[i].getValueEight() +" "+"Value9: " + amountArray[i].getValueNine() +

" "+"Value 10: " +amountArray[i].getValueTen() );

System.out.println(" ");

System.out.println(" ");

}

}

}   

  

for my last class...I am pretty sure that I have that correct. but I can attach it if it makes it easier to look at everything. It is basically the class for my

variables, and accessors and mutators....

Explanation / Answer

Nothing complex in it bro. But ll need the bean class as well. You didnt upload the full question. upload he bean in which variables and mutators and accessors are there. Then i ll do it. nothing to worry