Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions 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.
expand button
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
Check Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY