Concept explainers
Create an application that lets you enter a new customer or a new employee.
Console
Welcome to the Person Manager
Create customer or employee? (c/e):
Error! This entry is required. Try again.
Create customer or employee? (c/e): p
Error! Entry must be 'c' or 'e'. Try again.
Create customer or employee? (c/e): c
First name: Steve
Last name: Trevor
Customer number: M10293
You entered a new Customer:
Name: Steve Trevor
Customer Number: M10293
Continue? (y/n): y
Create customer or employee? (c/e): e
First name: Diana
Last name: Prince
SSN: 111-22-3333
You entered a new Employee:
Name: Diana Prince
SSN: xxx-xx-3333
Continue? (y/n): OK
Error! Entry must be 'y' or 'n'. Try again.
Continue? (y/n): n
Specifications
Create a class named Person with these constructors and methods:
public Person(String first, String last)
public String getFirstName()
public void setFirstName(String first)
public String getLastName()
public void setLastName()
The Person class should override the toString() method so it returns the first name and last name in this format:
Name: Frank Jones
Create a class named Customer that inherits the Person class and contains these constructors and methods:
public Customer(String first, String last, String number)
public String getCustomerNumber()
public void setCustomerNumber(String number)
The Customer class should override the toString() method so it returns the value returned by the toString() method of the Person class appended with the customer number, like this:
Name: Frank Jones
Customer Number: J54128
Create a class named Employee that inherits the Person class and contains these constructors and methods:
public Employee(String first, String last, String ssn)
public String getSsn()
public void setSsn(String ssn)
The getSsn() method should return a masked version of the social security number that only reveals the last four numbers.
The Employee class should override the toString() method so it returns the value returned by the toString() method of the Person class appended with the social security number, like this:
Name: Frank Jones
SSN: xxx-xx-1111
[Hint: toString() can invoke getSsn() ]
Use the Console class presented in chapter 7 or an enhanced version of it to get and validate the user's entries.
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 7 images
- T or F Number fields store values that represent quantities, measurements, and scores, for example. T or F The introduction should be the principal section of a formal report. T or F The Import Spreadsheet Wizard can help you import data from Excel into a new Access table. Which of the following properties can you set for a Short Text field? Format Decimal Places Default Value Input Mask What type of graphic illustrates changes in data over time? Line chart Flowchart Pie chart Tablearrow_forwardI need assistance on this C# program if possible please. A dog shelter would like a simple system to keep track of all the dogs that pass through their facility. You are required to make a command line-based dog shelter management application. Your application must allow a user to add, edit, search and view Contacts. The program must have a menu consisting of the following six (6) options: Add dog View all dogs View all available dogs View specific dog Update dog home status Exit Brief descriptions of each option in the menu Menu Item Description Add Dog 1) Asks the user for all the state value information for a dog. 2) Checks if there is space in the array to hold the new dog. 3) Check that the dogId is not already used in the system. 4) Creates a new Dog object and adds it to the array if there is space. If the array is full, print “Sorry… the Shelter is Full!”. Note: All new dogs have no home as yet (foundHome = false). View all dogs This menu option shows…arrow_forwardCreate an application that calculates and displays the starting and ending monthly balances for a checking account and a savings account. Console Welcome to the Account applicationStarting BalancesChecking: $1,000.00Savings: $1,000.00Enter the transactions for the monthWithdrawal or deposit? (w/d): wChecking or savings? (c/s): cAmount?: 500Continue? (y/n): yWithdrawal or deposit? (w/d): dChecking or savings? (c/s): sAmount?: 200Continue? (y/n): nMonthly Payments and FeesChecking fee: $1.00Savings interest payment: $12.00Final BalancesChecking: $499.00Savings: $1,212.00 Create a class named AccountBalanceApp that uses these objects to process and display deposits and withdrawals. my code: import java.text.DecimalFormat;import java.util.Scanner; public class AccountBalanceApp { private static Scanner sc = new Scanner(System.in);private static CheckingAccount ca = new CheckingAccount(1.0);private static SavingsAccount sa = new SavingsAccount(.01); public static void…arrow_forward
- Study the scenario and complete the questions that follow: Hotel Application Shawn owner of a small hotel has asked that a new online-based application be built that would permit potential visitors to make a room reservation, indicating the dates and type of room- they want. The system is supposed to distinguish already registered customers to speed up the process; else, they must register as a new client. Each reservation is given a reservation ID or code. Before clients checking into the hotel, they may enter the reservation ID to alter or cancel their reservation. The changes might include changing the dates, room number or type, or the number of visitors per room. The administrator must use the reservation ID to check the client in when they arrive. The same ID is supposed to be used by the proposed system when the clients check-out to record their payment. An electronic printed invoice must be generated to the client's email. The system must allow the hotel manager to view reports…arrow_forwardUsing C# in Visual Studio: Create the graphical user interfaces as shown below. Provide appropriate names for all the controls.arrow_forwardWhat is a user story? a)User’s need b)Client’s need c)Both A and B d)All of the abovearrow_forward
- Microsoft Visual Basic Studio Programming1. Change the CalcDiscount procedure to a function.2. Make the necessary modifications to the bntCalc_Click procedure.arrow_forwardwhat tool allows a user to create there own recurring tasks to be run automatically? a) at b) atq c) atp d) crontabarrow_forwardSelect the correct option for the question shown below.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education