Question

In: Computer Science

***This program is to be created using Python*** Requirements to be numbered in program01.py: Print “This...

***This program is to be created using Python***

Requirements to be numbered in program01.py:

  1. Print “This program provides concert seat assignments.”
  2. Ask the user their musical preference and take the following actions based on their potential input:
  • Classical – proceed with the program (i.e. move the next requirement)
  • – output a message that states “We do not recognize the musical genre.” Then end the program.
  1. Ask the user to enter the following data about themselves:

• First Name

• Last Name

• Membership Level

      i. Composer

      ii. Conductor

      iii. Musician

• Seat Preference

      i. Orchestra

      ii. Main

      iii. Balcony

• Meal Type

      i. Chicken

      ii. Fish

      iii. Vegan

  1. Message the following based on criteria (include First and Last Name in messages to user):

• if Composer and Orchestra:

    i. “You qualify for these are exceptional seats!”

• if Composer and Main:

    i. “The seats in the main section are good seats.”

• if Composer and Balcony:

    i. “Interesting, let us know if you want closer seats.”

• if Conductor and Orchestra:

    i. “Member level of Composer required if you want to sit in the orchestra section.”

• if Conductor and Main:

    i. “The seats in the main section are good seats.”

• if Conductor and Balcony:

    i. “Interesting, let us know if you want closer seats.”

• if Musician and Orchestra:

    i. “Member level of Composer required if you want to sit in the orchestra section.”

• if Musician and Main:

    i. “Member level of Composer or Conductor required if you want to sit in the main section.”

• if Musician and Balcony:

  1. “Your balcony seats are confirmed.”
  1. After the concert, the user completes a survey. Ask the user to input a sentiment score 1 – 5 (1 = strongly disagree; 5 = strongly agree) in response to these three statements:

• The concert was wonderful.

• The food was fantastic.

• The seats were superb.

  1. Message to the user based on the following:

• if Composer and (total score less than 12 or any score less than 4):

    i. “Dear Composer, Your survey score of <score> was lower than we would like. Please give us another opportunity soon.”

• Else // Composer

    i. “Thank you for being a Composer member and for having a good time!”

• if Conductor and (total score less than 11 or any score less than 3):

    i. “Dear Conductor, Your survey score of <score> was lower than we would like. The next time you attend we will be nicer.

• Else //Conductor

    i. “Thank you for being a Conductor member and for having a good time!”

• if Musician and (total score less than 10 or any score less than 2):

    i. “Dear Musician, Your survey score of <score> was lower than we would like. You will have more fun next time.”

• Else // Musician

  1. “Thank you for being a Musician member and for having a good time!”

Solutions

Expert Solution

Code:

import sys

print("This program provides concert seat assignments")

fn=input("Enter your first name\n")

ln=input("Enter your last name\n")

ml=int(input("Select the membership level\n1)Composer\n2)Conductor\n3)Musician\n*Options 1 or 2 or 3\n"))

sp=int(input("Select your seat preference\n1)Orchestra\n2)Main\n3)Balcony\n*Options 1 or 2 or 3\n"))

mt=int(input("Select the preffered meal type\n1)Chicken\n2)Fish\n3)Vegan\n*Options 1 or 2 or 3\n"))

if(ml==1 and sp==1):

    print("Mr./Mrs.",fn,ln,", you qualify for these exceptional seats!\n")

elif(ml==1 and sp==2):

    print("Mr./Mrs.",fn,ln,", the seats in the main section are good seats.\n")

elif(ml==1 and sp==3):

    print("Mr./Mrs.",fn,ln,", interesting, let us know if tou want closer seats.\n")

elif(ml==2 and sp==1):

    print("Mr./Mrs.",fn,ln,", member level of Composer required if you want to sit in the orchestra section.\n")

elif(ml==2 and sp==2):

    print("Mr./Mrs.",fn,ln,", the seats in the main section are good seats.\n")

elif(ml==2 and sp==3):

    print("Mr./Mrs.",fn,ln,", interesting, let us know if you want closer seats.\n")

elif(ml==3 and sp==1):

    print("Mr./Mrs.",fn,ln,", member level of Composer required if you want to sit in the orchestra section.\n")

elif(ml==3 and sp==2):

    print("Mr./Mrs.",fn,ln,", member level of Composer or Conductor required if you want to sit in the main section.\n")

elif(ml==3 and sp==3):

    print("Mr./Mrs.",fn,ln,", your balcony seats are confirmed.\n")

else:

    print("We do not recognize the musical genre.\n")

    sys.exit()

print("Please rate our services\n*From 1-5 (1 being the lowest and 5 being the highest).\n")

c=int(input("How well did you like the concert.\n"))

f=int(input("How well did you like the food.\n"))

s=int(input("How well did you like the seats.\n"))

if ( ml==1 and ( (c+f+s <12 ) or (c<4 or f<4 or s<4))):

    print("Dear Composer, Your survey score of ",c+f+s," was lower than we would like. Please give us another opportunity soon.\n")

elif(ml==1):

    print("Thank you for being a Composer member and for having a good time!\n")

if ( ml==2 and ( (c+f+s <11 ) or (c<3 or f<3 or s<3))):

    print("Dear Conductor, Your survey score of ",c+f+s," was lower than we would like. Please give us another opportunity soon.\n")

elif(ml==2):

    print("Thank you for being a Conductor member and for having a good time!\n")

if ( ml==3 and ( (c+f+s <10 ) or (c<2 or f<2 or s<2))):

    print("Dear Musician, Your survey score of ",c+f+s," was lower than we would like. Please give us another opportunity soon.\n")

elif(ml==3):

    print("Thank you for being a Musician member and for having a good time!\n")

Output:


Related Solutions

Assignment Requirements Write a python application that consists of two .py files. One file is a...
Assignment Requirements Write a python application that consists of two .py files. One file is a module that contains functions used by the main program. NOTE: Please name your module file: asgn4_module.py The first function that is defined in the module is named is_field_blank and it receives a string and checks to see whether or not it is blank. If so, it returns True, if not it return false. The second function that is defined in the module is named...
Using Python, write a program named hw3b.py that meets the following requirements: Welcome the user to...
Using Python, write a program named hw3b.py that meets the following requirements: Welcome the user to Zion's Pizza Restaurant and ask the user how many people are in their dinner group. If the answer is more than eight (8), print a message saying they'll have to wait for a table. Otherwise, report that their table is ready and take their order. Assume the client orders one pizza, and ask what he/she would like on their pizza, include a loop that...
Using Python, write a program that meets the following requirements: Make a list called sandwich_orders and...
Using Python, write a program that meets the following requirements: Make a list called sandwich_orders and fill it with the names of various sandwiches. Make an empty list called finished_sandwiches. Loop through the list of sandwich orders and spring a message for each order such as "I am working on your tuna sandwich" As each sandwich is made, move it to the list of finished sandwiches. After all the sandwiches have been made, print a message listing each sandwich that...
What to do: 1. Write a Python program, a1.py with the following characteristics: a) there are...
What to do: 1. Write a Python program, a1.py with the following characteristics: a) there are at least 40 lines of comments and 40 lines of code (1 point) b) the problem is described at the top of the program in a readable fashion (1 point) c) the code includes at least one instance of each of the five learning objectives listed above. (3 points) d) the code solves the problem. This may be assessed in part by a 'code...
What to do: 1. Write a Python program, a1.py with the following characteristics: a) there are...
What to do: 1. Write a Python program, a1.py with the following characteristics: a) there are at least 40 lines of comments and 40 lines of code (1 point) b) the problem is described at the top of the program in a readable fashion (1 point) c) the code includes at least one instance of each of the five learning objectives listed above. (3 points) d) the code solves the problem. This may be assessed in part by a 'code...
Python Create a Python script file called hw3.py. Ex. 1. Write a program that inputs numbers...
Python Create a Python script file called hw3.py. Ex. 1. Write a program that inputs numbers from the user until they enter a 0 and computes the product of all these numbers and outputs it. Hint: use the example from the slides where we compute the sum of a list of numbers, but initialize the variable holding the product to 1 instead of 0. print("Enter n") n = int(input()) min = n while n != 0: if n < min:...
Write a python program using the following requirements: Create a class called Sentence which has a...
Write a python program using the following requirements: Create a class called Sentence which has a constructor that takes a sentence string as input. The default value for the constructor should be an empty string The sentence must be a private attribute in the class contains the following class methods: get_all_words — Returns all the words in the sentence as a list get_word — Returns only the word at a particular index in the sentence Arguments: index set_word — Changes...
Using Python, write a program named hw3a.py that meets the following requirements: Create a dictionary called...
Using Python, write a program named hw3a.py that meets the following requirements: Create a dictionary called glossary. Have the glossary include a list of five (5) programing words you have learned in chapters 4-6. Use these words as keys to your dictionary. Find the definition of these words and use them as the values to the keys. Using a loop, print each word and its meaning as neatly formatted output. Create three dictionaries called person. Have each of the person...
2) create a python program that uses a for loop and range to print out the...
2) create a python program that uses a for loop and range to print out the values 10 8 6 4 2 3) Create a python program that yses a for loop to print out ["bob","al","bert"]
Write a Python program stored in a file q3.py that: Gets single-digit numbers from the user...
Write a Python program stored in a file q3.py that: Gets single-digit numbers from the user on one line (digits are separated by white space) and adds them to a list. The first digit and the last digit should not be a zero. If the user provides an invalid entry, the program should prompt for a new value. Converts every entry in the list to an integer and prints the list. The digits in the list represent a non-negative integer....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT