
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
solution in python language

Transcribed Image Text:(IronChair) Attributes:
Write a python program to define a class (Chairs) with the following members:
• size
Attributes:
(IronChair) Methods:
• price
• quantity
setSize: changes the size.
getSize: returns the size.
init :a parameterized constructor with user-determined values.
calculate_bill: prints bill after the điscount, which is determined as follows:
if the size is Small, the discount is 25%
if the size is Medium, the discount is 50%.
if the size is Large, the discount is 70%.
Methods:
• setPrice: changes the price.
• setQuantity. changes the quantity.
getPrice: returns the price.
getQauntity: returns the quantity.
init_: a parameterized constructor with user-determined values.
• calculate_bill: prints "Still your bill is 0 JD".
Testing Code:
Create objects from: Chairs, WoodenChair, and IronChair classes with these
values:
Price
Quantity
Define two classes (WoodenChair) and (IronChair) that are inherited from class (Chairs)
with the following members:
Chairs Object
WoodenChair Object
IronChair Object
0.0
2.00
A (model)
Large (size)
2.50
(WoodenChair) Attributes:
• model
Change model attribute of WoodenChair Object to "B".
Change size attrībute of IronChair Object to "Small".
(WoodenChair) Methods:
Call Get Methods for all data attrībutes in all classes.
• setModel: changes the model.
getModel: returns the model.
init_: a parameterized constructor with user-determined values.
• calculate_bill: prints bill after the discount, which is determined as follows:
if the model is A, the discount is 20%.
- if the model is B, the discount is 40%.
- if the model is C, the discount is 60%.
Call calculate_bill method for all objects.
Output:
Chairs Price is: 0.0, Chairs Quantity is: 0
Still your bill is 0 JD.
woodenChair Price is: 2.0 , woodenChair Quantity is: 5 , woodenChair Model is: B
Bill in Wooden-Chairs Class is: 6.0 JD.
ironChair Price is: 2.5 , ironChair Quantity is: 2 , ironChair Size is: Small
Bill in Iron-Chairs Class is: 3.75 JD.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 6 images

Knowledge Booster
Similar questions
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY