Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA, create a Person class and 2 objects of this class. you will also display the data from each object. Please deliver: A zipped

IN JAVA, create a Person class and 2 objects of this class. you will also display the data from each object.

Please deliver: A zipped file project with 2 classes: App and Classes.

image text in transcribedThe Person Class

The attribute are:

-String first name

-String lastname

-string homeTown

- String state.

The APP CLASS: create 2 Person objects call p1 and p2

__p1 data:

firstname = William

lastname= thompson

hometown = houston

state= TX

--p2 data:

firstname = Thomas

lastname = Lang

hometown= columbus

state= SC

1. display the data for each object as specified below:

-If the state attribute is "SC", display the object's attribute name plus the message "is from South Carolina"

-Of the state state attribute is not "SC", display the object's attribute name plus the message "is from out-of-state"

-make sure you display the data using the object p1 and p2:

-> A statement using a fixed string is not a correct answer : System.out.println("William Thompson is out-of-state"); is not the answer

-> looking at the data and having specific "system.out" is not the correct answer

->You need to use if statements to handle any variable/object.

Output should be:

William is out-of-state

Thomas is from South Carolina

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions