Question

To conclude the project, use the UML diagram you created last week and create an application in Visual Studio named School. O
<<Java Class>> GPerson (default package) firstName: String a lastName: String dateOfBirth String idNumber. String Person oget
0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

class Person{

String firstName;

String lastName;

char gender;

String dateOfBirth;

String idNumber;

Person(){}

/**

* @return the firstName

*/

public String getFirstName() {

return firstName;

}

/**

* @param firstName the firstName to set

*/

public void setFirstName(String firstName) {

this.firstName = firstName;

}

/**

* @return the lastName

*/

public String getLastName() {

return lastName;

}

/**

* @param lastName the lastName to set

*/

public void setLastName(String lastName) {

this.lastName = lastName;

}

/**

* @return the gender

*/

public char getGender() {

return gender;

}

/**

* @param gender the gender to set

*/

public void setGender(char gender) {

this.gender = gender;

}

/**

* @return the dateOfBirth

*/

public String getDateOfBirth() {

return dateOfBirth;

}

/**

* @param dateOfBirth the dateOfBirth to set

*/

public void setDateOfBirth(String dateOfBirth) {

this.dateOfBirth = dateOfBirth;

}

/**

* @return the idNumber

*/

public String getIdNumber() {

return idNumber;

}

/**

* @param idNumber the idNumber to set

*/

public void setIdNumber(String idNumber) {

this.idNumber = idNumber;

}

}

class Faculty extends Person{

String officeHours;

String rank;

Faculty(){

super();

}

/**

* @return the officeHours

*/

public String getOfficeHours() {

return officeHours;

}

/**

* @param officeHours the officeHours to set

*/

public void setOfficeHours(String officeHours) {

this.officeHours = officeHours;

}

/**

* @return the rank

*/

public String getRank() {

return rank;

}

/**

* @param rank the rank to set

*/

public void setRank(String rank) {

this.rank = rank;

}

public String toString() {

return "Name: "+getFirstName()+" "+getLastName()+"\nGender: "+getGender()+"\nDate of Birth: "+getDateOfBirth()+"\nID Number: "+getIdNumber()+"\nOffice Hours: "+getOfficeHours()+"\nRank: "+getRank();

}

}

class Staff extends Person{

String title;

Staff(){

super();

}

/**

* @return the title

*/

public String getTitle() {

return title;

}

/**

* @param title the title to set

*/

public void setTitle(String title) {

this.title = title;

}

public String toString() {

return "Name: "+getFirstName()+" "+getLastName()+"\nGender: "+getGender()+"\nDate of Birth: "+getDateOfBirth()+"\nID Number: "+getIdNumber()+"\nTitle: "+getTitle();

}

}

class Student extends Person{

int status;

Student(){

super();

}

/**

* @param status the status to set

*/

public void setStatus(int status) {

this.status = status;

}

/**

* @return the status

*/

public int getStatus() {

return status;

}

public String toString() {

return "Name: "+getFirstName()+" "+getLastName()+"\nGender: "+getGender()+"\nDate of Birth: "+getDateOfBirth()+"\nID Number: "+getIdNumber()+"\nStatus: "+getStatus();

}

}

Add a comment
Know the answer?
Add Answer to:
To conclude the project, use the UML diagram you created last week and create an application...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • To conclude the project, use the UML diagram you created last week and create an application in Visual Studio name...

    To conclude the project, use the UML diagram you created last week and create an application in Visual Studio named School. Once you have written the code, be sure and test it to ensure it works before submitting it. Below is the UML diagram for the basic class we created last week for your reference, but for this project be sure you use the one that you created last week. Good luck and be sure to get started early in...

  • In c# So far, you have created object-oriented code for individual classes. You have built objects...

    In c# So far, you have created object-oriented code for individual classes. You have built objects from these classes. Last week, you created a UML for new inherited classes and objects. Finally, you have used polymorphism. When you add abstraction to this mix, you have the “4 Pillars of OOP.” Now, you begin putting the pieces together to create larger object-oriented programs. Objectives for the project are: Create OO classes that contain inherited and polymorphic members Create abstracted classes and...

  • Objectives: GUI Tasks: In Lab 4, you have completed a typical function of music player --...

    Objectives: GUI Tasks: In Lab 4, you have completed a typical function of music player -- sorting song lists. In this assignment, you are asked to design a graphic user interface (GUI) for this function. To start, create a Java project named CS235A4_YourName. Then, copy the class Singer and class Song from finished Lab 4 and paste into the created project (src folder). Define another class TestSongGUI to implement a GUI application of sorting songs. Your application must provide the...

  • CS1180 Lab 9 Students will learn how to create a user-defined class. Part 1. Create a...

    CS1180 Lab 9 Students will learn how to create a user-defined class. Part 1. Create a user-defined class. 1. Follow the UML diagram below to create a user-defined class, Automobile When implementing the constructors, use the default value of 0 for numeric types and "unknown" for VehicleMake and VehicleModel when not given as a parameter Implement the toString method in a format ofyour choosing, as long as it clearly includes information for all four member variables Make sure to include...

  • What this Lab Is About: Given a UML diagram, learn to design a class Learn how...

    What this Lab Is About: Given a UML diagram, learn to design a class Learn how to define constructor, accessor, mutator and toStringOmethods, etc Learn how to create an object and call an instance method. Coding Guidelines for All ments You will be graded on this Give identifiers semantic meaning and make them easy to read (examples numStudents, grossPay, etc) Keep identifiers to a reasonably short length. Use upper case for constants. Use title case (first letter is u case)...

  • Introduction In this lab, you will be working with three classes: Person, Student, and Roster. Person...

    Introduction In this lab, you will be working with three classes: Person, Student, and Roster. Person and Student represent individuals with a first and last name as String class variables, and Student has an additional int class variable that represents a ID number. The Roster class represents a group of people that are objects of either the Person or Student class. It contains an ArrayList. The Person class has been completed for you with class variables, a constructor, and a...

  • Java Homework Problems: 4. • Examine AddImport.java. – Perform the following: – Replace the fully qualified...

    Java Homework Problems: 4. • Examine AddImport.java. – Perform the following: – Replace the fully qualified name to access the Jlabel component with an import statement. – To import classes from the util package, replace multiple import statements with a single import statement. /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.util.Calendar; import java.util.Date; public...

  • Create a NetBeans project called "Question 1". Then create a public class inside question1 package called Author according to the following information (Make sure to check the UML diagram)

    Create a NetBeans project called "Question 1". Then create a public class inside question1 package called Author according to the following information (Make sure to check the UML diagram) Author -name:String -email:String -gender:char +Author(name:String, email:String, gender:char) +getName():String +getEmail):String +setEmail (email:String):void +getGender():char +tostring ):String . Three private instance variables: name (String), email (String), and gender (char of either 'm' or 'f'): One constructor to initialize the name, email and gender with the given values . Getters and setters: get Name (), getEmail() and getGender (). There are no setters for name and...

  • I need to get this two last parts of my project done by tonight. If you...

    I need to get this two last parts of my project done by tonight. If you see something wrong with the current code feel free to fix it. Thank you! Project 3 Description In this project, use project 1 and 2 as a starting point and complete the following tasks. Create a C++ project for a daycare. In this project, create a class called child which is defined as follows: private members: string First name string Last name integer Child...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT