NL Can is a local can-making company that makes cans using an eco-friendly material. Recently a number of new eco-friendly paint companies have started up In the area and they have been placing large orders for paint cans in which to put their eco-friendly paint. NL Coan has asked you to design, Implement and test a Python class, CanOrder, to generate order objects for cans with the following attributtes (Instance variables) and class variables. materlal used for the quantity of cans ordered, and the total cost of the order with appropriate descripthv labels, as shown in the sample output Also Include a main function to test the defined class as follows: • create 2 Canorder objects • print information about each order using the special_ _) method change the height of the can in the second order and print the order ID, the updated height and the updated total cost of the order with appropriate descriptive labels • print the total number of orders with an approprlate descriptive label Class variables: • NooFOrders is a class variable that keeps track of the number of orders created (Initially O): NoOFOrders automatically Increments with each new object created, Ie, when the first object is created, NooF0rders should become 1, when the second object is created, Moof0rders should change to 2, etc • NextOrderlo is a class varilable, Initialized to 100, which is used to generate the orderio number for each order as a sequence of even numbers, starting with 100; 1.e, the first order would have an orderio of 100, the second order created would have an orderiD of 102, etc. Instance variables: • ozdesID Is a unique number identifytng the can order and is set using the NexsOrdezlo class variable • quaneityorderedis the number of cans ordered (default value 0) • sadius is the radius of the can In inches (default value 0.0) • heighe is the height of the can in Inches (default value 0.0) • handie is a True/False value Indicating if the cans in the order should have a handle (True) or not (False) • print the total cost of all the orders (both orders, Including the effect of the changed helght of the second order), with an appropriate descriptive label Call the file contalning your class and main function, nl_cans.py. (default value False) Sample input/output: Ozder ID: 100 Also include the following methods: • a constructor method for the CanOrder class with default values for all 4 parameters (not including the self parameter) • three accessor methods, one to retrieve the ID of the order, one for the radlus, and one for the helght two mutator methods, one to change the radius of the can, and one to change the height of the can a method called getTotalsurfaceirea to compute and return the total surface area of all cans ordered; the formula for the surface area of a can is: 2er- 2arh (note: use the math library to get the constant variable pi and the pow function) • a method called gettoralcoss to compute and return the total cost of the order, where the cost of the material used is half of a cent (S0.005) per square centimetre of surface area and if handles are required. then an extra fifty cents (S0.50) is added for each can • the special _) method to print the Information about the order including the orderio, the radius and the height of the can, the quantity ordered, the handle option (True/False), the total surface area of material used for the quantity of cans ordered, and the total cost of the order with appropriate descriptive -l- -- -- -- a- --------- Can Radsus: 5 em Can Height: 10 cm Quantity Ozdezed: 100 cans Handle Needed? False Total Surface Area: 47123.9 sg.em. Iosal Coss: $235. 62 Order ID: 102 Can Radiu:: 7.5 cm Can Height: 20 em Quantisy Ozdered: 300 cans Handle Needed? True Total Surface Area: 3e8772.09 q. em. Total Cont: $2093.86 The height of cans for Ozder ID 102 has been changed to 21.00. The new cost of for Order ID 102 is $2164.55.

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
NL Can is a local can-making company that makes cans using an eco-friendly materlal. Recently a number of
new eco-friendly palnt companles have started up In the area and they have been placing large orders for
materlal used for the quantity of cans ordered, and the total cost of the order with appropriate descriptive
labels, as shown In the sample output
palnt cans In whlch to put their eco-friendly palnt. NL Can has asked you to design, Implement and test a
Python class, CanOrder, to generate order objects for cans with the following attributes (Instance varlables)
Also Include a main function to test the defined class as follows:
and class varlables.
• create 2 CanOrder objects
• print Information about each order using the special stz ) method
• change the helght of the can In the second order and print the order ID, the updated helght and the
Class variables:
• NoOfOrders Is a class varlable that keeps track of the number of orders created (Initially O):
NoOFOrders automatically Increments with each new object created, I.e., when the first object Is
created, NoO£Orders should become 1, when the second object is created, No0FOrders should
updated total cost of the order with approprlate descriptive labels
• print the total number of orders with an approprlate descriptive label
change to 2, etc.
• NextOrderNo is a class varlable, Initlalized to 100, which Is used to generate the orderiD number for
each order as a sequence of even numbers, starting with 100; I.e., the first order would have an orderiD of
100, the second order created would have an orderID of 102, etc.
Instance variables:
• orderID Is a unique number Identifylng the can order and Is set using the NextOrderNo class varlable
• quantityOrdered is the number of cans ordered (default value 0)
• rzdius is the radlus of the can In Inches (default value 0.0)
• height Is the height of the can In Inches (default value 0.0)
• handle isa True/False value Indicating If the cans In the order should have a handle (True) or not (False)
(default value False)
• print the total cost of all the orders (both orders, Including the effect of the changed helght of the second
order), with an approprlate descriptive label
Call the file contalning your class and main function, nl_cans.py.
Sample Input/output:
Order ID: 100
Also include the following methods:
a constructor method for the CanOrder class with default values for all 4 parameters (not Including the
self parameter)
• three accessor methods, one to retrieve the ID of the order, one for the radlus, and one for the helght
• two mutator methods, one to change the radlus of the can, and one to change the helght of the can
• a method called getTotalsurfacekrea to compute and return the total surface area of all cans
ordered; the formula for the surface area of a can Is: 2ar- 2arh (note: use the math library to get the
constant varlable pi and the pow function)
• a method called getTotal1cost to compute and return the total cost of the order, where the cost of the
materlal used Is half of a cent (So.005) per square centimetre of surface area and If handles are required,
then an extra fifty cents ($0.50) Is added for each can
• the speclalstr_() method to print the Information about the order Including the orderiD, the radlus
and the helght of the can, the quantity ordered, the handle optlon (True/False), the total surface area of
Can Radius: 5 cm
Can Height: 10 cm
Quantity Ordered: 100 cans
Handle Needed? False
Total Surface Area: 47123.89 =q. cm.
Total Cost: $235.62
Order ID: 102
Can Radius: 7.5 cm
Can Height: 20 cm
Quantity Ordered: 300 cans
Handle Needed? True
Total Surface Area: 388772.09 g.cm.
Total Cost: $2093.86
materlal used for the quantity of cans ordered, and the total cost of the order with appropriate descriptive
1- ... ta al.-..---.
The height of cans for Order ID 102 has been changed to 21.00.
The new cost of for Order ID 102 is $2164.55.
--
The total number of orders received was 2.
O Download
A Print
>
The tota1 cost of all orders received was $2400.17.
Transcribed Image Text:NL Can is a local can-making company that makes cans using an eco-friendly materlal. Recently a number of new eco-friendly palnt companles have started up In the area and they have been placing large orders for materlal used for the quantity of cans ordered, and the total cost of the order with appropriate descriptive labels, as shown In the sample output palnt cans In whlch to put their eco-friendly palnt. NL Can has asked you to design, Implement and test a Python class, CanOrder, to generate order objects for cans with the following attributes (Instance varlables) Also Include a main function to test the defined class as follows: and class varlables. • create 2 CanOrder objects • print Information about each order using the special stz ) method • change the helght of the can In the second order and print the order ID, the updated helght and the Class variables: • NoOfOrders Is a class varlable that keeps track of the number of orders created (Initially O): NoOFOrders automatically Increments with each new object created, I.e., when the first object Is created, NoO£Orders should become 1, when the second object is created, No0FOrders should updated total cost of the order with approprlate descriptive labels • print the total number of orders with an approprlate descriptive label change to 2, etc. • NextOrderNo is a class varlable, Initlalized to 100, which Is used to generate the orderiD number for each order as a sequence of even numbers, starting with 100; I.e., the first order would have an orderiD of 100, the second order created would have an orderID of 102, etc. Instance variables: • orderID Is a unique number Identifylng the can order and Is set using the NextOrderNo class varlable • quantityOrdered is the number of cans ordered (default value 0) • rzdius is the radlus of the can In Inches (default value 0.0) • height Is the height of the can In Inches (default value 0.0) • handle isa True/False value Indicating If the cans In the order should have a handle (True) or not (False) (default value False) • print the total cost of all the orders (both orders, Including the effect of the changed helght of the second order), with an approprlate descriptive label Call the file contalning your class and main function, nl_cans.py. Sample Input/output: Order ID: 100 Also include the following methods: a constructor method for the CanOrder class with default values for all 4 parameters (not Including the self parameter) • three accessor methods, one to retrieve the ID of the order, one for the radlus, and one for the helght • two mutator methods, one to change the radlus of the can, and one to change the helght of the can • a method called getTotalsurfacekrea to compute and return the total surface area of all cans ordered; the formula for the surface area of a can Is: 2ar- 2arh (note: use the math library to get the constant varlable pi and the pow function) • a method called getTotal1cost to compute and return the total cost of the order, where the cost of the materlal used Is half of a cent (So.005) per square centimetre of surface area and If handles are required, then an extra fifty cents ($0.50) Is added for each can • the speclalstr_() method to print the Information about the order Including the orderiD, the radlus and the helght of the can, the quantity ordered, the handle optlon (True/False), the total surface area of Can Radius: 5 cm Can Height: 10 cm Quantity Ordered: 100 cans Handle Needed? False Total Surface Area: 47123.89 =q. cm. Total Cost: $235.62 Order ID: 102 Can Radius: 7.5 cm Can Height: 20 cm Quantity Ordered: 300 cans Handle Needed? True Total Surface Area: 388772.09 g.cm. Total Cost: $2093.86 materlal used for the quantity of cans ordered, and the total cost of the order with appropriate descriptive 1- ... ta al.-..---. The height of cans for Order ID 102 has been changed to 21.00. The new cost of for Order ID 102 is $2164.55. -- The total number of orders received was 2. O Download A Print > The tota1 cost of all orders received was $2400.17.
Expert Solution
steps

Step by step

Solved in 2 steps

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