Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Brinda has recently joined a company and she is working as a software engineer. She was associated with a project to work on relationships.To get

Brinda has recently joined a company and she is working as a software engineer. She was associated with a project to work on relationships.To get hold of the topic she starts writing a code where she takes the details of her colleagues and displays them in an ordered way. Let's help Brinda to complete her code (Without using Super keyword).

CreateUserclass as the parent with the following attributes.

DataTypeVariableStringnameIntegeragestringgender

Use __init__() constructor to initialize the variables with respect toclass.

Create a classContactclass with the following attributes.

VariableDatatypephoneNoIntegerEmail idstringAddressstringUseruser

Use the following method to display the details in both class.

Sl.NoMethodDescription1.def __str__()This method is used to return the string whichneedsto be printed

Note:

Create two separate class User and Contact whichextends User. And use __str__() in both the class.

Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, attribute names, and method names should be the same as specified in the problem statement.

Input Format:

The first line of the input consists of string value corresponding to the name.

The second line of the input consists of Integer value corresponding to age.

The third line of the input consists of string value corresponding to gender.

The fourth line of the input consists of an integer value corresponding to the phone number.

The fifth line of input consists of string value corresponding to the email id.

The sixth line of the input consists of string value corresponding to the address.

Output Format:

Refer sample input-output format for better understanding.

Sample input-output:

Enter Name

Chandan v

Enter Age

22

Enter Gender

Male

Enter Phone Number

8892563578

Enter Email i..v@gmail.com

Enter Address

Ramakrishna nagar,Mysore.

Name:chandanv

Age:22

Gender:Male

Phone Number:8892563578

Email i..v@gmail.com

Address:Ramakrishnanagar,Mysore.

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions