Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions

Question

Who prevails and why? Discuss.

Answered: 1 week ago

Question

What are the benefits to China from adopting IFRS?

Answered: 1 week ago