Question: Please complete Case A and Case C import java.util.*; public class Assignment4 { public static void main (String[] args) { // local variables, can be

 Please complete Case A and Case C import java.util.*; public class Please complete Case A and Case C import java.util.*; public class Assignment4 { public static void main (String[] args) { // local variables, can be accessed anywhere from the main method char choice = 'Q'; String line = new String(); // instantiate a Employee object Employee e1 = new Employee(); //Create a Scanner object to read user input Scanner scan = new Scanner(System.in); do // will ask for user input { System.out.print("What action would you like to perform? "); printMenu(); line = scan.nextLine(); if (line.length() == 1) { // get the choice as a character choice = line.charAt(0); choice = Character.toUpperCase(choice); // matches one of the case statement switch (choice) { case 'A': //Add an employee /*read first_name, last_name, age, address, base salary then call the appropriate methods of the employee instance e1 to set those values */ break; case 'D': //Display Employee System.out.print(e1); break; case 'C': // change address /* read street name, city, state, zipcode and call appropriate methods of e1 to change the address */ break; case 'Q': //Quit break; case '?': //Display Menu printMenu(); break; default: System.out.print("Unknown action "); break; } } else { System.out.print("Unknown action "); } } while (choice != 'Q'); } /** The method printMenu displays the menu to a user **/ public static void printMenu() { System.out.print("Choice\t\tAction " + "------\t\t------ " + "A\t\tAdd an Employee " + "D\t\tDisplay an Employee Info " + "C\t\tChange Address " + "Q\t\tQuit " + "?\t\tDisplay Menu Again "); } } 

Employee first name Sting last name Sring agent base salary double dressAddress 1 Address Assignment -streetName Saring city Saring state Saring Taipcode int main Serinon) void printMenuvoid +Employee o +Saring setNameo Saring getSalary +Additess getAddress) void setNameString string) void avoid seAgeGiot void setBase salary double) avoid setAddress string string string int) to Stine0 Saring Address Address string Sarine String int) + void changeAiress(Saring Sains. Starting int - Saring to Sarine0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!