UNIT 3 ACTIVITY 1 A high school volleyball team is selling raffle tickets to raise money...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
UNIT 3 ACTIVITY 1 A high school volleyball team is selling raffle tickets to raise money for new equipment. The sale will last three days and the tickets cost one dollar. Each team member is required to record the number of tickets they sell each day. The captain of the volleyball team would like a raffle ticket sales program that will allow her to enter each team member's daily ticket sales and calculate the total ticket sales made by the team. She also thinks it would be a good idea to give team members special prizes based on the total number of tickets they sell. So, the program should also display the total tickets sold by each member and the prize they earned. The prizes for different ticket sales levels are shown below: TABLE 1 Prizes 0 Tickets Sold 1 - 10 11 - 20 21 - 30 31 - 40 41 or greater No prize Cup holder Plastic mug Miniature volley ball Team tee shirt Team sweat shirt Prize Program Input: The program will accept the following input: Team Member First Name Day 1 Ticket Sales Day 2 Ticket Sales Day 3 Ticket Sales Program Output: The program will display a message with the team member's name, total ticket sales, and prize earned. Part 1 To complete Part 1 of this activity, follow the steps below: Step 1 Login to your PythonAnywhere account at https://www.pythonanywhere.com/login/ Step 2 Click on the PythonAnywhere logo at the top left of the screen to return to your Dashboard Step 3 Click on the Files link on the menu at the top right of the Dashboard page pythonanywhere. Send feedback Forum Help Blog Account Logout Dashboard Consoles Files Web Tasks Databases Step 4 Create a new Python program file called ticketSales.py (remember the .py at the end of your program name tells your interpreter this is a Python program file). ticketSales.py Step 5 Click on the New File button New file Step 6 Enter the following Python instructions below for your program-be sure to put the # sign in front of each of the comments used to document your program. 1 HNm tin rao am to A 98 NNN Nam 2 3 4 5 6 7 8 9 10 12 13 11 while getMoreSales == "y": 14 15 16 17 18 19 20 22 23 24 25 21 #Get sales information 26 27 #This program calculates the total sales by team member for #The program awards team member prizes based on total ticke #Team member total sales and prize awards are printed to the #The program terminates when the user does not enter a 'y' 28 getMoreSales = "y" teamSales = 0 29 #Create a while loop to process all of the team members # Set starting values for program variables dayOneSales = 0 dayTwoSales = 0 dayThreeSales = 0 memberSales = 0 prizeEarned = ". print(" ") teamMember Name = input("Enter the team member's first na dayOneSales = input("Enter the day 1 ticket sales ") day TwoSales input("Enter the day 2 ticket sales ") dayThreeSales = input("Enter the day 3 ticket sales ") memberSales = int (dayOneSales) + int(day TwoSales) + int teamSales = (teamSales + memberSales) = 30 31 #Determine Prize based on total tickets sold y ay ay $ 556 % % w w w x 32 33 34 35 36 37 41 42 44 45 48 49 50 51 52 53 54 56 57 58 59 if memberSales >= 41: prizeEarned = 'Team Sweat Shirt!' elif memberSales >= 31: prizeEarned = 'Team Tee Shirt!' elif memberSales >= 21: prizeEarned = 'Miniature volley ball!' elif memberSales >= 11: prizeEarned = 'Plastic mug!' elif memberSales >= 1: prizeEarned = 'Cup Holder!' else: prizeEarned = "Team members must sell at least one print (teamMemberName, "sold ", str(memberSales), tic if memberSales > 0: print("prize awarded is: ", prizeEarned) else: print (prizeEarned) #Check if program should end else: getmoreSales = input ("enter y to enter more sales or n n #At the end of the program print total sales for the team print("The total ticket sales for the team were: , str Step 7 Save and Run your program H Save Save as... If you have errors: Look carefully at your code to make sure you have typed it correctly and that you have quotes after all string values. >>> Run Make sure you don't have a typo in your variable names Make sure you have opening and closing parenthesis Make sure you have a # sign in front of each comment Once you have found the error and fixed it, be sure to Save your code and then Run it again. Keyboard shortcuts: Normal and run again Share H Save Save as... >>> Run Testing Your Program You can use the sample input for below to test your program. If you coded your program correctly, it should generate the total ticket sales and prize information shown below: TABLE 2 Sample input Day 1 Day 2 Sales Sales Name Melanie Jacob Sarah Justin Amber 35 20 5 15 7 10 10 7 5 5 5 5 2 5 2 Day 3 Sales Total Sales 50 35 14 25 14 Prize Team sweat shirt Team tee shirt Plastic mug Miniature volley ball Plastic mug If you coded your program correctly, you should see the following output for Melanie: Enter the team member first name Melanie Enter the day 1 ticket sales 35 Enter the day 2 ticket sales 10 Enter the day 3 ticket sales 5 Melanie sold 50 tickets prize awarded is: Team Sweat Shirt! enter y to enter more sales or n to end the program A Few Things to Note about Activity 1 Part 1 Line 6 sets the getMoreSales variable to a starting value of y! This variable is used to control the while loop that starts on line 11. Because the while loop is a pre-test loop, it must have a starting value of 'y' to loop the first time. Lines 25-27 uses the Python input function to get the ticket sales for each of the three from the keyboard. Remember the results from the Python input instruction are in a string format. Line 28 has the following instruction: memberSales = int(dayOneSales) + int(day TwoSales) + int(day ThreeSales) This instruction converts the dayOneSales, dayTwoSales and dayThreeSales variable values obtained from the input function to integers that can be used in addition. Lines 33 - 42 use if and elseif instructions to determine the member prizes based on the number of tickets sold. Part 2 The school principal has purchased FAST STARTER! Buttons for volley ball team members that sell over 30 tickets on the first day of the raffle ticket sale. To complete the second part of this activity, you will modify the your ticketSales.py program to calculate the total tickets sold on the first day of the raffle. The program should print the team member's name and that they get a FAST STARTER! button for selling more than 30 tickets on the first day. Hint: For Melanie, the output would be as follows: Enter the team member's Enter the day 1 ticket first name Melanie sales 35 Enter the day 2 ticket sales 10 Enter the day 3 ticket sales 5 Melanie sold 50 tickets prize awarded is: Team Sweat Shirt! Melanie gets a FAST STARTER! button for selling 35 tickets on the first day! enter to enter more sales or n to end the prog Submit your work Submit your Python file by clicking the Share button in the upper right corner. Then click the Get sharing link button. Then, click on the clipboard icon next to the link to copy it. Paste the link into this activity's dropbox to submit. TABLE 3 Grading Rubric Program Formatting Program comments Program Output Meets Display Requirements Full Credit The program uses proper indentation for all functions, while loops, and conditional logic. The program is fully documented using comments. Program correctly and completely displays team member's name, total ticket sales and prize earned using the test data provided without warnings. Partial Credit The program uses proper indentation for most of the functions, while loops, and conditional logic. The program uses some comments. Program correctly displays some of the required output using the test data provided with some warnings. Little Credit The program does not use proper indentation for functions, while loops, and conditional logic. The program does not use comments. Program does not display required output and has multiple errors and/or warnings. UNIT 3 ACTIVITY 1 A high school volleyball team is selling raffle tickets to raise money for new equipment. The sale will last three days and the tickets cost one dollar. Each team member is required to record the number of tickets they sell each day. The captain of the volleyball team would like a raffle ticket sales program that will allow her to enter each team member's daily ticket sales and calculate the total ticket sales made by the team. She also thinks it would be a good idea to give team members special prizes based on the total number of tickets they sell. So, the program should also display the total tickets sold by each member and the prize they earned. The prizes for different ticket sales levels are shown below: TABLE 1 Prizes 0 Tickets Sold 1 - 10 11 - 20 21 - 30 31 - 40 41 or greater No prize Cup holder Plastic mug Miniature volley ball Team tee shirt Team sweat shirt Prize Program Input: The program will accept the following input: Team Member First Name Day 1 Ticket Sales Day 2 Ticket Sales Day 3 Ticket Sales Program Output: The program will display a message with the team member's name, total ticket sales, and prize earned. Part 1 To complete Part 1 of this activity, follow the steps below: Step 1 Login to your PythonAnywhere account at https://www.pythonanywhere.com/login/ Step 2 Click on the PythonAnywhere logo at the top left of the screen to return to your Dashboard Step 3 Click on the Files link on the menu at the top right of the Dashboard page pythonanywhere. Send feedback Forum Help Blog Account Logout Dashboard Consoles Files Web Tasks Databases Step 4 Create a new Python program file called ticketSales.py (remember the .py at the end of your program name tells your interpreter this is a Python program file). ticketSales.py Step 5 Click on the New File button New file Step 6 Enter the following Python instructions below for your program-be sure to put the # sign in front of each of the comments used to document your program. 1 HNm tin rao am to A 98 NNN Nam 2 3 4 5 6 7 8 9 10 12 13 11 while getMoreSales == "y": 14 15 16 17 18 19 20 22 23 24 25 21 #Get sales information 26 27 #This program calculates the total sales by team member for #The program awards team member prizes based on total ticke #Team member total sales and prize awards are printed to the #The program terminates when the user does not enter a 'y' 28 getMoreSales = "y" teamSales = 0 29 #Create a while loop to process all of the team members # Set starting values for program variables dayOneSales = 0 dayTwoSales = 0 dayThreeSales = 0 memberSales = 0 prizeEarned = ". print(" ") teamMember Name = input("Enter the team member's first na dayOneSales = input("Enter the day 1 ticket sales ") day TwoSales input("Enter the day 2 ticket sales ") dayThreeSales = input("Enter the day 3 ticket sales ") memberSales = int (dayOneSales) + int(day TwoSales) + int teamSales = (teamSales + memberSales) = 30 31 #Determine Prize based on total tickets sold y ay ay $ 556 % % w w w x 32 33 34 35 36 37 41 42 44 45 48 49 50 51 52 53 54 56 57 58 59 if memberSales >= 41: prizeEarned = 'Team Sweat Shirt!' elif memberSales >= 31: prizeEarned = 'Team Tee Shirt!' elif memberSales >= 21: prizeEarned = 'Miniature volley ball!' elif memberSales >= 11: prizeEarned = 'Plastic mug!' elif memberSales >= 1: prizeEarned = 'Cup Holder!' else: prizeEarned = "Team members must sell at least one print (teamMemberName, "sold ", str(memberSales), tic if memberSales > 0: print("prize awarded is: ", prizeEarned) else: print (prizeEarned) #Check if program should end else: getmoreSales = input ("enter y to enter more sales or n n #At the end of the program print total sales for the team print("The total ticket sales for the team were: , str Step 7 Save and Run your program H Save Save as... If you have errors: Look carefully at your code to make sure you have typed it correctly and that you have quotes after all string values. >>> Run Make sure you don't have a typo in your variable names Make sure you have opening and closing parenthesis Make sure you have a # sign in front of each comment Once you have found the error and fixed it, be sure to Save your code and then Run it again. Keyboard shortcuts: Normal and run again Share H Save Save as... >>> Run Testing Your Program You can use the sample input for below to test your program. If you coded your program correctly, it should generate the total ticket sales and prize information shown below: TABLE 2 Sample input Day 1 Day 2 Sales Sales Name Melanie Jacob Sarah Justin Amber 35 20 5 15 7 10 10 7 5 5 5 5 2 5 2 Day 3 Sales Total Sales 50 35 14 25 14 Prize Team sweat shirt Team tee shirt Plastic mug Miniature volley ball Plastic mug If you coded your program correctly, you should see the following output for Melanie: Enter the team member first name Melanie Enter the day 1 ticket sales 35 Enter the day 2 ticket sales 10 Enter the day 3 ticket sales 5 Melanie sold 50 tickets prize awarded is: Team Sweat Shirt! enter y to enter more sales or n to end the program A Few Things to Note about Activity 1 Part 1 Line 6 sets the getMoreSales variable to a starting value of y! This variable is used to control the while loop that starts on line 11. Because the while loop is a pre-test loop, it must have a starting value of 'y' to loop the first time. Lines 25-27 uses the Python input function to get the ticket sales for each of the three from the keyboard. Remember the results from the Python input instruction are in a string format. Line 28 has the following instruction: memberSales = int(dayOneSales) + int(day TwoSales) + int(day ThreeSales) This instruction converts the dayOneSales, dayTwoSales and dayThreeSales variable values obtained from the input function to integers that can be used in addition. Lines 33 - 42 use if and elseif instructions to determine the member prizes based on the number of tickets sold. Part 2 The school principal has purchased FAST STARTER! Buttons for volley ball team members that sell over 30 tickets on the first day of the raffle ticket sale. To complete the second part of this activity, you will modify the your ticketSales.py program to calculate the total tickets sold on the first day of the raffle. The program should print the team member's name and that they get a FAST STARTER! button for selling more than 30 tickets on the first day. Hint: For Melanie, the output would be as follows: Enter the team member's Enter the day 1 ticket first name Melanie sales 35 Enter the day 2 ticket sales 10 Enter the day 3 ticket sales 5 Melanie sold 50 tickets prize awarded is: Team Sweat Shirt! Melanie gets a FAST STARTER! button for selling 35 tickets on the first day! enter to enter more sales or n to end the prog Submit your work Submit your Python file by clicking the Share button in the upper right corner. Then click the Get sharing link button. Then, click on the clipboard icon next to the link to copy it. Paste the link into this activity's dropbox to submit. TABLE 3 Grading Rubric Program Formatting Program comments Program Output Meets Display Requirements Full Credit The program uses proper indentation for all functions, while loops, and conditional logic. The program is fully documented using comments. Program correctly and completely displays team member's name, total ticket sales and prize earned using the test data provided without warnings. Partial Credit The program uses proper indentation for most of the functions, while loops, and conditional logic. The program uses some comments. Program correctly displays some of the required output using the test data provided with some warnings. Little Credit The program does not use proper indentation for functions, while loops, and conditional logic. The program does not use comments. Program does not display required output and has multiple errors and/or warnings.
Expert Answer:
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these programming questions
-
Pumpkin Mfg., Inc., is currently operating at only 88 92" tabindex="0"> percent of fixed asset capacity. Current sales are $780,000 . Fixed assets are $$470,000 and sales are projected to grow to...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
For the given year, find the standard quotas for the New York City boroughs given in Table 17.5 in Problems 23-28. Assume there are eight council seats. Table 17. 5 1990 Year Total 1790 49 1800 81...
-
Our Federal corporate tax laws provide numerous incentives intended to promote certain activities, industries and job creation. Some argue that these measures are ineffective while others say that...
-
Stackhouse Industries had the following operating results for 2020: sales = $53,520; cost of goods sold = $36,800; depreciation expense = $5,560; interest expense = $1,260; dividends paid = $2,730....
-
The following accounts and amounts (balances are normal balances) were taken from the records of New Manufacturers at 30 June 2025. Required (a) Prepare a cost of goods manufactured statement for the...
-
La Jolla Beverage Products is considering producing a wine cooler that would be a blend of a white wine, a ros wine, and fruit juice. To meet taste specifications, the wine cooler must consist of at...
-
Suppose Peter retires at age 60 with $1,000,000 in pension. How much will he and his beneficiaries receive if he requests 3 equal periodic payments with the first one to be received at age 60 and the...
-
The net income of the Gary and Tucker partnership is $124500. The partnership agreement specifies that profits and losses will be shared equally after salary allowances of $100700 (Gary) and $149900...
-
Entering negotiations with a potential customer, a supplier starts with an inflated price per part. They have a significant cushion to work with as they negotiate downward. They are trying to take...
-
Create a marketing plan for kia based off of their 2 0 2 3 market line report.
-
Successful product positioning centers around two key principles: developing a unique selling proposition, and communicating the: a . features and options the product hasOb. priceO c . store...
-
1. Deniz invests $ 9 , 8 0 0 in a deposit account; After 3 years, its value is $ 1 3 , 2 5 0 . What is the rate of return on investment? 2. Derya deposits $ 5 , 0 0 0 into a bank account compounded...
-
The management of Motion Pictures Cinema is considering whether to show an advance screening of a forthcoming action movie. The hiring of the film will cost the cinema 2,500 and the revenue obtained...
-
Thinking Critically About Statistics in Business Today Business Travel Findings from the Bureau of Transportation Statistics National Household Travel Survey revealed that more than 405 million...
-
The manager of a local convenience store is expanding his line of small toy items. To price these new items, the manager is looking at the prices being charged by competing retailers in his area. For...
-
I recently went out to dinner with my brother and my family. We decided we wanted wings for an appetizer and had a choice of getting 10 wings for $4.95 or 20 wings for $7.95. I thought we should get...
-
We have suggested in this chapter that labor economists believe that labor supply curves typically slope up when wages are low and down when wages are high. This is sometimes referred to as a...
-
Everyday Application: Cities and Land Values: Some of the models that we introduced in this chapter are employed in modeling the pattern of land and housing values in an urban area. A: One way to...
-
Trust Management System: A university would like to develop a system for students to evaluate their peers performance in some group projects. Students ratings in various categories will affect a...
-
Building trust in potential students to join music classes by a music teacher a. Explain the above scenario. b. Draw a class diagram for it. c. Document a detailed and significant use case. d. Create...
-
Define accessibility SAP.
Study smarter with the SolutionInn App