Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee

Human-written only.

24/7 Support

Anytime, anywhere.

Plagiarism Free

100% Original.

Expert Tutors

Masters & PhDs.

100% Confidential

Your privacy matters.

On-Time Delivery

Never miss a deadline.

Write program in C++ , that stored the information about your client University in two terms

Computer Science Feb 09, 2021

Write program in C++ , that stored the information about your client University in two terms. First stored their employee History with respect to department e.g.., (CS), second stored their student information with respect to his/her personal as well as academic record. You should require to store information by using classes and make proper display function for it.
 Hint:
There will be two class with special member function.
a. Employee Class
b. Student Class  
  Each class have at least 6 - 8 Data Member Objects 

Expert Solution

Answer:

The running C++ source code is provided as below. The file name is main.cpp 

you can use any C++  compiler to run this file. The comments have also been added for code segments for better understanding of the code. The output screenshot(capture) has also been attached for your reference.

Step-by-step explanation

Source Code:

#include<iostream>

#include <string>//for using String datatype

using namespace std; 

// Declaraing Student class with 6-8 parameters

class Student

private: 

  int StudentId; //primary key

  string StudentName;

  string ContactNumber;

  string ContactEmail;

  string Address;

  string DOB; //stores date of birth

  char Grade ;//stores student grade 

  string PresentClass; //Current class of Student in which he is studing

  

  //Constructor for initializing the Student information

  public:

  Student(int StudentId,string StudentName,string ContactNumber, string ContactEmail,string Address,string DOB,char Grade ,string PresentClass) 

  { 

    this->StudentName=StudentName;

    this->StudentId=StudentId;

    this->ContactNumber=ContactNumber;

    this->ContactEmail=ContactEmail;

    this->Address=Address;

    this->DOB=DOB;

    this->Grade=Grade;

    this->PresentClass=PresentClass;

     

  }

  //StudentDisp() funtion will display the details of the Student

   void StudentDisp() 

  { 

    cout<< StudentId;

     cout<< StudentName; 

     cout<< ContactNumber; 

      cout<< ContactEmail; 

      cout<< Address; 

       cout<< DOB; 

       cout<< Grade; 

       cout<< PresentClass<<endl; 

  }

   

}; 

 //Declaraing Employee class with 6-8 parameters  

class Employee

private: 

  int EmployeeId; //primary key

  string EmployeeName;

  string ContactNumber;

  string ContactEmail;

  string Address;

  string DOB;

  string Department ;//Which department Employee belongs to

  string Course; //Which course Employee teachs

  //Constructor for initializing the Employee information

  public:

   Employee(int EmployeeId,string EmployeeName,string ContactNumber, string ContactEmail,string Address,string DOB,string Department ,string Course) 

    { 

    this->EmployeeId=EmployeeId;

    this->EmployeeName=EmployeeName;

    this->ContactNumber=ContactNumber;

    this->ContactEmail=ContactEmail;

    this->Address=Address;

    this->DOB=DOB;

    this->Department=Department;

    this->Course=Course;

    

  }

  //This function displays the Emploees details

   void EmployeeDisp() 

  { 

    cout<< EmployeeId;

     cout<< EmployeeName; 

     cout<< ContactNumber; 

      cout<< ContactEmail; 

      cout<< Address; 

       cout<< DOB; 

       cout<< Department; 

       cout<< Course<<endl; 

  }

   

};   

int main() 

{  

  //instantiate Employee class using constructor

  Employee e..m@gmail.com","newyork","12/11/1990","CS","JAVA");

  emp.EmployeeDisp(); //display employee details

  //instantiate Student class using constructor

  Student st (..b@gmail.com","newyork","02/01/1996",'A',"High School");

  st.StudentDisp(); //display Student details

  return 0; 

Output as Attached below-

As we can see in the output in the 1st row employee details are displayed and in the 2nd Row Student details are displayed.

PFA

Archived Solution
Unlocked Solution

You have full access to this solution. To save a copy with all formatting and attachments, use the button below.

Already a member? Sign In
Important Note: This solution is from our archive and has been purchased by others. Submitting it as-is may trigger plagiarism detection. Use it for reference only.

For ready-to-submit work, please order a fresh solution below.

Or get 100% fresh solution
Get Custom Quote
Secure Payment