×

Warning

JUser: :_load: Unable to load user with ID: 990

SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 3 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 04 Jan 2018 My Price 8.00

Provided in the class is getter and setter methods

C&O: Person

You have been provided with a class Person, it contains the following attributes: name (String), address (String), and a unique pps number (int). Provided in the class is getter and setter methods for each attribute, and a showPerson() method that will print all the details about a Person to the screen. 

 

Add a toString() that returns a string representation of the attributes of a Person (see sample output below for format).

Write a main method in a new class called TestPerson.java and in this method:

i). Declare an array of 3 Person objects. Instantiate each of the Person objects by obtaining the necessary attribute values from a user through keyboard input.

ii). Call the getName(), getAddress() and getPPSNo() methods to print the information of the first person to the screen (it should be displayed exactly as the sample output below).

iii). Call the setName(<…>) and setAddress(<…>) method to change the information on the second Person.

iv). Use a ‘for’ loop and the showPerson() method to print all the information for all People to the screen (it should be displayed exactly as the sample output below).

v). Call the toString() method on the 3rd Person object in the array.

Input:

n, where n is any String value   

Sample input:

Bob Hope  

Output:

The TestPerson class should print to the screen the correct message to match each question given above.

Sample output:

Person 1 is called Bob Hope

They live in America

Their PPS Number is 1001.0

*****PERSONAL DETAILS*****

NAME: Bob Hope

ADDRESS: America

PPS NUMBER: 1001

*****PERSONAL DETAILS*****

NAME: Paul Smyth

ADDRESS: Dublin

PPS NUMBER: 1002

*****PERSONAL DETAILS*****

NAME: Mary Murphy

ADDRESS: Mayo

PPS NUMBER: 1003

NAME: Mary Murphy

ADDRESS: Mayo

PPS NUMBER: 1003

 

Answers

(5)
Status NEW Posted 04 Jan 2018 02:01 PM My Price 8.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)