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();
}
}
To conclude the project, use the UML diagram you created last week and create an application...
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 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...
Exercise 1 • Examine ShoppingCart.java. – Perform the following: – Use the indexOf method to get the index for the space character (" ") within custName. Assign it to spaceIdx. – Use the substring method and spaceIdx to get the first name portion of custName. Assign it to firstName and print firstName. public class ShoppingCart { public static void main (String[] args){ String custName = "Steve Smith"; String firstName; int spaceIdx; // Get the...
JAVA PROGRAMMING In this final review lab from our intro course, use the Name class you created in the previous lab. In this lab, create a Student class with the following class variable: Student name: Name (Note: Name is a datatype) Student Id: String Create the getter and setter methods. In addition to these methods, create a toString() method, which overrides the object class toString() method. This override method prints the current value of any of this class object. Complete...
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...
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...
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 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...
You must use C Language. The Main Objective: Make the first and last name ALL CAPITALS even if the user types in lower case letters. Lastly, flip the first name and last name around. So: HEIDI, HATFIELD to HATFIELD, HEIDI. (PLEASE uppercase all the letters) End Goal: HATFIELD, HEIDI KAISER, RUSSELL LIPSHUTZ, HOWARD PENKERT, DAWN WRIGHT, ELIZABETH Please use this reference below, to fix the code given. Code given is below, I want the user to be able to enter...