Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please give the answer in python coding 2. Create a class Publication with public member variables publisher, title and price with the following specifications: .Addinit()

image text in transcribed

please give the answer in python coding

2. Create a class Publication with public member variables publisher, title and price with the following specifications: .Addinit() method of the class that initialises string member variables to empty strings (18) and numeric values to 0 Add two more methods to the class: populate () o and display () . method is used to assign values to the member variables of the The populate () class. o The display) method is used to display the member variables of the class. . Derive a class Book from Publication. o The class Book has two public member variables of its own: ISBN and authorname o Define the init) method for the class Book that initialises string member variables to empty strings and numeric values to 0, and also override the populate) and display) methods of the base class. o Create an instance bookobj of the class Book in a main program. The main program should then prompt the user to enter the following values: PublisherRomfort Title: Computing for beginners Price: 280 ISBN 123456 Author Name: Jo Mahlangu The above attributes should be assigned to the instance bookObj using its populate () method. o Then display all these attributes back to the console using the display) method of the instance bookobj

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions