#include <iostream>
#include <string>
using namespace std;
// Person class
class Person{
private:
int SSN;
protected:
string firstName,lastName;
int age;
public:
Person(int SSN,string
firstName,string lastName,int age){
this->SSN =
SSN;
this->firstName = firstName;
this->lastName = lastName;
this->age =
age;
}
Person(string firstName,string
lastName){
this->firstName = firstName;
this->lastName = lastName;
}
void printPerson(){
cout<<firstName<<" "<<lastName<<",
"<<age<<endl;
}
};
// Student Class
class Student:public Person{
private:
string major;
double GPA;
public:
Student(int SSN,string
firstName,string lastName,int age,string major,double
GPA):Person(SSN,firstName,lastName,age){
this->major =
major;
this->GPA =
GPA;
}
void printGPA(){
cout<<"GPA: "<<GPA<<endl;
}
};
// Faculty class
class Faculty:public Person{
private:
string department,position;
public:
Faculty(string firstName,string
lastName,string department,string
position):Person(firstName,lastName){
this->department = department;
this->position = position;
}
void printPosition(){
cout<<department<<",
"<<position<<endl;
}
void printPerson(){
cout<<"Advisor: "<<endl;
cout<<"Dr.
"<<firstName<<" "<<lastName<<endl;
}
};
int main(){
Student s1(358,"Ann","Beech",21,"Computer
Science",3.75);
s1.printPerson();
s1.printGPA();
cout<<endl;
Faculty f1("Tony","Gaddis","CIS","Associate
Professor");
f1.printPerson();
f1.printPosition();
}
/* OUTPUT */
/* PLEASE UPVOTE */
2- Write a program that has a Person class, a Student class, that is derived from...
In Java(The Person, Student, Employee, Faculty, and Staff classes)Design a class named Person and its two derived classes named Student and Employee. MakeFaculty and Staff derived classes of Employee. A person has a name, address, phone number, and e-mail address. A student has a class status (freshman, sophomore, junior, or senior). An employee has an office, salary, and date hired. Define a class namedMyDate that contains the fields year, month, and day. A faculty member has office hours and a rank....
a c++ program (The Person, Student, Employee, Faculty, and Staff classes) Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A person has a name, address, phone number, and email address. A student has a class status (freshman, sophomore, junior, or senior). Define the status as a constant. An employee has an office, salary, and date hired. Use the MyDate classto create an object for date hired. A faculty...
Last picture is the tester program! In this Assignment, you will create a Student class and a Faculty class, and assign them as subclasses of the superclass UHPerson. The details of these classes are in the UML diagram below: UHPerson - name : String - id : int + setName(String) : void + getName(): String + setID(int) : void + getID(): int + toString(): String Faculty Student - facultyList : ArrayList<Faculty - rank: String -office Hours : String - studentList...
2. Write a program named lab3 2.app that contains a class named Student to store student information Information that will be relevant to store is first name, last name, id number, GPA, and major (1) Define a member function named set0, which allows you to set all member variables. This function has an empty parameter list, and its return type is void. So, within the function you'll prompt for information. Note: For entering major, if you need a space, use...
Develop a set of classes for a college to use in various student service and personnel applications. Classes you need to design include the following: • Person — A Person contains the following fields, all of type String: firstName, lastName, address, zip, phone. The class also includes a method named setData() that sets each data field by prompting the user for each value and a display method that displays all of a Person’s information on a single line at the...
Create a class hierarchy to be used in a university setting. The classes are as follows: The base class is Person. The class should have 3 data members: personID (integer), firstName(string), and lastName(string). The class should also have a static data member called nextID which is used to assign an ID number to each object created (personID). All data members must be private. Create the following member functions: o Accessor functions to allow access to first name and last name...
Student is a class that has the following instance variables: name (a String), yearInSchool (an int), and gpa (a double). Write a constructor for the Student class that takes parameters for these instance variables as initial values of the variables. (in Java)
java Practice Program 2: Create a project named Student that will cont ain two classes: Student and StudentClient Student class Instance variables . Name Social security number Gpa Methods: Constructor that accepts all three instance variables Getters for all three instance variables .Setters for name and social security number .Setter for gpa should only set the value if the value is between 0 and 4.0. toString-Outputs the values of the instance variables in this format: name: Smith; SSN: 333-99-4444 GPA:...
Using C++ Instructions Person Student Employee Write a program that simulates the three classes defined as shown: a. Use name as the only data member for the Person class. b. Use name and gpa as data members for the Student class. c. Use name and salary as data members for the Employee class. Demonstrate the relationship in a main function.
C++, entry level no pointers or vectors. Write a class called Person that has two data members - a string variable called name and a double variable called age. It should have a constructor that takes two values and uses them to initialize the data members. It should have get methods for both data members (getName and getAge), but doesn't need any set methods. Write a separate function (not part of the Person class) called stdDev that takes two parameters...