Write a python program to define a class (Chairs) with the following members:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

solution in python language

(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.
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 6 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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 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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY