Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

. Q1. Topic: Inheritance CL0-2 15 Marks Create a class named Person. It has two attribute as private, name as character array of size 50

image text in transcribed

image text in transcribed

. Q1. Topic: Inheritance CL0-2 15 Marks Create a class named Person. It has two attribute as private, name as character array of size 50 and age as int. Make a no argument constructor to set name equals to empty string and age equals to zero. Make a two argument constructor, the first argument changes the value of name and the second argument changes the value of age. Make void Get_Data() function to get name and age from user. Make void Show_Data() function show the value of name and age on screen. O Create another class named Student that is publically inherited from Person class. It has two attribute as private, degree as character array of size 50 and gpa as double data type. o Make a no argument constructor to set degree equals to empty string and gpa equals to 0. Also call the no argument constructor of parent class. Make a four argument constructor The first argument changes the value of name. O The second argument changes the value of age. The third argument changes the value of degree. The fourth argument changes the value of gpa. O to change name and age, call two argument constructor of parent class. Make void Get_Data() function to get value of name, age, degree and gpa from user. Also call Get_Data() function of parent class from child class. Make void show_Data() function to show value of name, age, degree and gpa on screen. Also call Show_Data() function of parent class from child class. Make a student object in main() and call above functions

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

1st Edition

1597496251, 978-1597496254

More Books

Students also viewed these Databases questions

Question

1. How else can Bob and John create a social media presence?

Answered: 1 week ago

Question

Determine the missing values

Answered: 1 week ago

Question

Which type of soil has more ability to absorb water?

Answered: 1 week ago

Question

1. PricewaterhouseCoopers

Answered: 1 week ago

Question

3. SCC Soft Computer

Answered: 1 week ago