Question: COSC 211 Programming assignment #1 (10 points) In this assignment, you are asked to write the definition for a person class and test it with

 COSC 211 Programming assignment #1 (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 Program1. Your program should be well documented and in particular, begin
with a series of comments specifying: your name, course t, section, semester

COSC 211 Programming assignment #1 (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 Program1. Your program should be well documented and in particular, begin with a series of comments specifying: your name, course t, section, semester and other relevant information a brief description of the program . ZOOM + a brief description of the program 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 Programi class. **You are expected to fill in the definitions for the methods in the Person class. Page > of 2 - ZOOM + Person class public class Person private String name; private int id; public Person() // default constructor public Person(String newName, int newld) // parameterized constructor public Person(Person other Person) // copy constructor public void setName(String name) public static void setName(Person p, String newName) public String getName() public void setId(int id) public static void setId(Person p, int newld) public int geld rog1.doc ownload prog1.doc (31.5 KB) Page > of 2 ZOOM + public static void settl(Person p, int newla) public int getId() public boolean equals(Person other Person) public String toString() 3 o D d) ING DELL ** 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(p2); Person p3 new Person(p2); System.out.println(p3); if (p2.equals(p3)) System.out.println(" Persons p2 and p3 are equal"); else ZOOM System.out.println(" Persons p2 and p3 are equal"); else 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(p1); p2.setId(1234); Person.setName(p2, "Jimmy"); System.out.println(p2); if (pl.getName().equals(p2.getName()) System.out.println("Persons pl and p2 have the same names"); clse p2.setId(1234); Person.setName(p2, "Jimmy"); System.out.println(p2); if (pl.getName().equals(p2.getName()) System.out.println("Persons pl and p2 have the same names"); else System.out.println("Persons pl and p2 have different names "); if (pl.getId=p2.getido) System.out.println("Persons pl and p2 have the same id"); else System.out.println("Persons pl and p2 have different id")

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!