Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Page 1 > of 2 ZOOM + COSC 211 Programming assignment 11 (10 points) In this assignment, you are asked to write the definition for

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Page 1 > of 2 ZOOM + COSC 211 Programming assignment 11 (10 points) In this assignment, you are asked to write the definition for a person class and test it with the driver program provided. The descriptions of the person class and the driver program are given in the following. Create a project named Projecti which contains the person class as well as the driver program Programl. Your program should be well documented and in particular, begin with a series of comments specifying: your name, course , section, semester and other relevant information a brief description of the program do IPM 12/01 Page > of 2 200M + Cut and paste the output of your program as a comment at the bottom of the source code. Submit your assignment on Canvas by uploading a zipped folder (with your name on it) which contains the java files for the Person class as well as the Programl class. * *You are expected to fill in the definitions for the methods in the Person class Person class public class Person private String name: private int id; o 3 NO 100 PM 7/21/ DELL Download prog1.doc (31.5 KB) Page > of 2 ZOOM + Person class public class Person public private String name private int id; public Person() // default constructor public Person(String newName, int newid) // parameterized constructor public Person(Person other Person) // copy constructor public void setName(String name) public static void setName(Person p, String new Name) public String getName() ver des prog1.doc Download prog1.doc (31.5 KB) Page 1 > of 2 - ZOOM + public void setidint id) public static void setId(Person p, int newld) public int getId() public boolean equals(Person other Person) public String toString() cover Laides Page 5 2 of 2 ZOOM + ** Please type in the following statements in the Programi class Driver program (Programl) for the Person class: Person pl = new Person("Tom", 1111), System.out.println(pl); Person p2 new Person{"Mary, 2222); System.out.println(2) Person p3 - new Penon(p2) System.out.println(p3) if (p2.equals(p3)) System.out.println("Persons p2 and p3 are equal" che > DOM C ENG NI 1 Online prog1.doc Download prog1.doc (31.5 KB) Page 2 of 2 ents 200M + che Ons System.out.println("Persons p2 and p3 are unequal"); System.out.println("Persons pl and p2 are being modified:"); Person.setId(pl. 1234); pl.setName("Jim"); System.out.println(pl); p2 seld(1234) Person.setName(p2. "Jimmy"); System.out.println(p2) Discover Guides if (pl.getName().equals(p2.getName()) System.out.println("Persons pl and p2 have the same names"); else Download prog1.doc (31.5 KB) Page

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

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions