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.
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...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
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
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