Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write python program Figure 1: UML diagram showing class interface relationship of musican instrumens: Output 7 [10 marks]: Create a list of instruments and add

write python program image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Figure 1: UML diagram showing class interface relationship of musican instrumens: Output 7 [10 marks]: Create a list of instruments and add all the above instruments in it. Then for each instrument in the list, display only its special feature (e.g., number of keys for percussion family instruments, number of strings for string family instruments, diameter of a drum, and made of for woodwind family instruments.). See the output below. Again, do not hard code any output data, you must obtain the values programmatically through invoking appropriate method offered in the class. Output 8 [10 marks]: Use list's sort() method to sort the instruments in the instrument list in price ascending order. [Hint: you may need to implement ge _() and _it () magic methods in an appropriate class to facilitate the sorting on the instrument list.] Display the name of the inctrument and its price by walking through the sorted instrument list, as below. Output 9 [15 marks]: Create following two orders by two customers Bob and Alice, respectively: order_Bob =Order(111, 'Bob' )# id of the order =111 and customer name = Bob order_Alice =Order(222, 'Alice' )# id of the order =222 and customer name = Alice Page 5 of 7 ST, Sheridan College Assignment 1 Have order_Bob order for one of each percussion family instrument and order_Alice order for one of each string family instrument. [Hint: Walkthrough the instrument list and add percussion family instruments in the orders list of order_Bob, and string family instruments in the orders list of order_Alice. Make use of the add_instrument(self, instrument) method.] Once the order list of Bob and Alice is populated, output the total price of all the instruments in each list, see the output below. Create another order instance for a custom order where the order id should be the last 3 digits of your Sheridan student number and use your first name as the customer's name. Then, ask the user to enter a set of instruments that you want to order. Please see the output below as a guide to obtain user input for instrument choices. For example, in the instruments in the orders list of order_Alice. Make use of the add_instrument/self, instrument) method.] Once the order list of Bob and Alice is populated, output the total price of all the instruments in each list, see the output below. Create another order instance for a custom order where the order id should be the last 3 digits of your Sheridan student number and use your first name as the customer's name. Then, ask the user to enter a set of instruments that you want to order. Please see the output below as a guide to obtain user input for instrument choices. For example, in the output below, user ordered for a flute, a drum, a xylophone and a piano by typing the string fdxp. The program then extracted each letter from the input string to learn about the instruments ordered and create the order list. This is a guideline only, you can use your own way to obtain user choice for instruments. Once the order list is created, output the total price of all the instruments ordered along with the names of instruments ordered (see the output below). Order total for Bob (111): 1164.49 Order total for Alice (222): 1330.99 Please enter your order by typing the letter for each instrument without any space: d= Drum, f= Fluet, h= Harp, p= Piano, v= Violin, and X=Xylophone fdxp Syed ordered for ['Drun', 'Fluet', 'Piano', 'Xylophone'] Order total for Syed (999): 1239.48 Please enter your order by typing the letter for each instrument without any space: d= Drum, f= Fluet, h= Harp, p= Piano, v= Violin, and X=Xyl ophone hdv Syed ordered for ['Drum', 'Harp', 'Violin'] Order total for syed (999):955.49

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions