Question: Problem 7 . ( Playing the Waltz ) Write a program called playwaltz.py that accepts from standard input, a sequence of 3 2 integers representing

Problem 7.(Playing the Waltz ) Write a program called playwaltz.py that accepts from standard input, a sequence of 32 integers representing the 32 measures of a waltz, and plays the waltz to standard audio. Before playing any audio, your program must check if the inputs are erroneous, and if so, must call sys.exit(message) to exit the program with an appropriate error message. Your program must check for the following errors: If the number of measures is not 32, exit with the message A waltz must contain exactly 32 measures. If a minuet measure is not from [1,176], exit with the message A minuet measure must be from [1,176]. If a trio measure is not from [1,96], exit with the message A trio measure must be from [1,96]. Note: No audio must be played in the event of an erro

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!