Question: C++ Read the following code carefully and make it compact so that it should take input in Person and Student object through default constructors in

C++

Read the following code carefully and make it compact so that it should take input in Person and Student object through default constructors in main(). Given Code: #include using namespace std; class Person { protected: int id; //4 char name[30]; //30 public: void setID() { cout<<"Enter ID:"; cin>>id; } void setName() { cout<<"Enter Name: "; cin>>name; } void showID() const { cout<<"ID is: "<

class Student: public Person //syntax of writing child class { private: char coursename[30]; char section; public: void setCourseName() { cout<<"Enter Course name: "; cin>>coursename; } void setSection() { cout<<"Enter Section: "; cin>>section; } void showCourseName() const { cout<<"Show Coursename: "<

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It seems that the question provided is incomplete The code snippet is missing the closin... View full answer

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!