———ANSWER USING PYTHON 3.7 —— Your cruise ship, the S.S. Rusty T. Buckette, hire
ID: 3728761 • Letter: #
Question
———ANSWER USING PYTHON 3.7 ——Your cruise ship, the S.S. Rusty T. Buckette, hires out for dinner party cruises.
Example:
A fund raising committee has agreed to pay you $30.00 per person provided that a minimum of 200 people sign up for a moonlight dinner dance cruise. Anxious for business (and to pay your crew), you agree to lower your price by 50 cents per ticket for EACH additional group of 10 people showing up over the minimum of 200. For example:
200 people Ticket Price is $30.00
210 people Ticket Price is $29.50
220 people Ticket Price is $29.00
230 people Ticket Price is $28.50
The ship's maximum carrying capacity is 500 passengers. You will incur a fixed cost of $2,500.00 no matter how many people show up. Your program should allow the following:
Allow user to start loop at any number of passengers from 1 to 500, subject to the maximum carrying capacity of 500 Allow user to select an ending number of passengers (ending must be greater than start but less than or equal to 500, maximum carrying capacity). Examples are user starts at 50 ends at 450, 20 ends at 230, start at 300 ends at 400) Compute the ticket price and profit for each group of passengers from your starting such as 1, 50, 200, 210, 220, 230, 240, 250, ... to your ending, such as 490, 500, Determine the maximum PROFIT, the number of passengers needed to generate that profit, and the ticket price that will generate that profit. Allow the program user (...that's you) to enter the proposed initial ticket price, the minimum passengers, the maximum number of passengers for this particular cruise. Calculate the ticket prices and profit for each group of passengers. The loop will execute a different number of times during the execution (Use a function to contain the calculations and resulting output?) For every group of 10 passengers, the ticket price is discounted by 50 cents. User can execute this any number of times. Logic should ask user if they wish to quit or continue.
Algorithms needed:
NP is the Number of Passengers
TP is the Proposed Ticket Price
MP is the Minimum Number of Passengers
Cost of Ticket = TP - (((NP - MP) /10) * .5)
Profit = (NP * Cost of Ticket) - 2500
Example of Input and Output
1 of 3 - Enter the minimum number of passengers: 150
Minimum Number of Passengers is set to 150
2 of 3 - Enter the maximum number of passengers: 450
Maximum Number of Passengers is set to 450
3 of 3 - Enter the Ticket Price: 20
Passenger Run from 150 To 450 with an initial ticket price of $20.00 with a fixed cost of $2,500.00
Discount per Ticket of $0.50 for each group of 10 Above the Starting Count of 150 Passengers
Number of Ticket
Passengers Price Gross Fixed Cost Profit
150 $ 20.00 $ 3,000.00 $ 2,500.00 $ 500.00
160 $ 19.50 $ 3,120.00 $ 2,500.00 $ 620.00
170 $ 19.00 $ 3,230.00 $ 2,500.00 $ 730.00
180 $ 18.50 $ 3,330.00 $ 2,500.00 $ 830.00
190 $ 18.00 $ 3,420.00 $ 2,500.00 $ 920.00
200 $ 17.50 $ 3,500.00 $ 2,500.00 $ 1,000.00
210 $ 17.00 $ 3,570.00 $ 2,500.00 $ 1,070.00
220 $ 16.50 $ 3,630.00 $ 2,500.00 $ 1,130.00
230 $ 16.00 $ 3,680.00 $ 2,500.00 $ 1,180.00
.
.
.
430 $ 6.00 $ 2,580.00 $ 2,500.00 $ 80.00
440 $ 5.50 $ 2,420.00 $ 2,500.00 $ -80.00
450 $ 5.00 $ 2,250.00 $ 2,500.00 $ -250.00
Maximum Profit $ 1,280.00
Maximum Profit Ticket Price $ 14.00
Maximum Profit Number of Passengers: 270
Run Another Contract (Y or N): ———ANSWER USING PYTHON 3.7 ——
Your cruise ship, the S.S. Rusty T. Buckette, hires out for dinner party cruises.
Example:
A fund raising committee has agreed to pay you $30.00 per person provided that a minimum of 200 people sign up for a moonlight dinner dance cruise. Anxious for business (and to pay your crew), you agree to lower your price by 50 cents per ticket for EACH additional group of 10 people showing up over the minimum of 200. For example:
200 people Ticket Price is $30.00
210 people Ticket Price is $29.50
220 people Ticket Price is $29.00
230 people Ticket Price is $28.50
The ship's maximum carrying capacity is 500 passengers. You will incur a fixed cost of $2,500.00 no matter how many people show up. Your program should allow the following:
Allow user to start loop at any number of passengers from 1 to 500, subject to the maximum carrying capacity of 500 Allow user to select an ending number of passengers (ending must be greater than start but less than or equal to 500, maximum carrying capacity). Examples are user starts at 50 ends at 450, 20 ends at 230, start at 300 ends at 400) Compute the ticket price and profit for each group of passengers from your starting such as 1, 50, 200, 210, 220, 230, 240, 250, ... to your ending, such as 490, 500, Determine the maximum PROFIT, the number of passengers needed to generate that profit, and the ticket price that will generate that profit. Allow the program user (...that's you) to enter the proposed initial ticket price, the minimum passengers, the maximum number of passengers for this particular cruise. Calculate the ticket prices and profit for each group of passengers. The loop will execute a different number of times during the execution (Use a function to contain the calculations and resulting output?) For every group of 10 passengers, the ticket price is discounted by 50 cents. User can execute this any number of times. Logic should ask user if they wish to quit or continue.
Algorithms needed:
NP is the Number of Passengers
TP is the Proposed Ticket Price
MP is the Minimum Number of Passengers
Cost of Ticket = TP - (((NP - MP) /10) * .5)
Profit = (NP * Cost of Ticket) - 2500
Example of Input and Output
1 of 3 - Enter the minimum number of passengers: 150
Minimum Number of Passengers is set to 150
2 of 3 - Enter the maximum number of passengers: 450
Maximum Number of Passengers is set to 450
3 of 3 - Enter the Ticket Price: 20
Passenger Run from 150 To 450 with an initial ticket price of $20.00 with a fixed cost of $2,500.00
Discount per Ticket of $0.50 for each group of 10 Above the Starting Count of 150 Passengers
Number of Ticket
Passengers Price Gross Fixed Cost Profit
150 $ 20.00 $ 3,000.00 $ 2,500.00 $ 500.00
160 $ 19.50 $ 3,120.00 $ 2,500.00 $ 620.00
170 $ 19.00 $ 3,230.00 $ 2,500.00 $ 730.00
180 $ 18.50 $ 3,330.00 $ 2,500.00 $ 830.00
190 $ 18.00 $ 3,420.00 $ 2,500.00 $ 920.00
200 $ 17.50 $ 3,500.00 $ 2,500.00 $ 1,000.00
210 $ 17.00 $ 3,570.00 $ 2,500.00 $ 1,070.00
220 $ 16.50 $ 3,630.00 $ 2,500.00 $ 1,130.00
230 $ 16.00 $ 3,680.00 $ 2,500.00 $ 1,180.00
.
.
.
430 $ 6.00 $ 2,580.00 $ 2,500.00 $ 80.00
440 $ 5.50 $ 2,420.00 $ 2,500.00 $ -80.00
450 $ 5.00 $ 2,250.00 $ 2,500.00 $ -250.00
Maximum Profit $ 1,280.00
Maximum Profit Ticket Price $ 14.00
Maximum Profit Number of Passengers: 270
Run Another Contract (Y or N):
Your cruise ship, the S.S. Rusty T. Buckette, hires out for dinner party cruises.
Example:
A fund raising committee has agreed to pay you $30.00 per person provided that a minimum of 200 people sign up for a moonlight dinner dance cruise. Anxious for business (and to pay your crew), you agree to lower your price by 50 cents per ticket for EACH additional group of 10 people showing up over the minimum of 200. For example:
200 people Ticket Price is $30.00
210 people Ticket Price is $29.50
220 people Ticket Price is $29.00
230 people Ticket Price is $28.50
The ship's maximum carrying capacity is 500 passengers. You will incur a fixed cost of $2,500.00 no matter how many people show up. Your program should allow the following:
Allow user to start loop at any number of passengers from 1 to 500, subject to the maximum carrying capacity of 500 Allow user to select an ending number of passengers (ending must be greater than start but less than or equal to 500, maximum carrying capacity). Examples are user starts at 50 ends at 450, 20 ends at 230, start at 300 ends at 400) Compute the ticket price and profit for each group of passengers from your starting such as 1, 50, 200, 210, 220, 230, 240, 250, ... to your ending, such as 490, 500, Determine the maximum PROFIT, the number of passengers needed to generate that profit, and the ticket price that will generate that profit. Allow the program user (...that's you) to enter the proposed initial ticket price, the minimum passengers, the maximum number of passengers for this particular cruise. Calculate the ticket prices and profit for each group of passengers. The loop will execute a different number of times during the execution (Use a function to contain the calculations and resulting output?) For every group of 10 passengers, the ticket price is discounted by 50 cents. User can execute this any number of times. Logic should ask user if they wish to quit or continue.
Algorithms needed:
NP is the Number of Passengers
TP is the Proposed Ticket Price
MP is the Minimum Number of Passengers
Cost of Ticket = TP - (((NP - MP) /10) * .5)
Profit = (NP * Cost of Ticket) - 2500
Example of Input and Output
1 of 3 - Enter the minimum number of passengers: 150
Minimum Number of Passengers is set to 150
2 of 3 - Enter the maximum number of passengers: 450
Maximum Number of Passengers is set to 450
3 of 3 - Enter the Ticket Price: 20
Passenger Run from 150 To 450 with an initial ticket price of $20.00 with a fixed cost of $2,500.00
Discount per Ticket of $0.50 for each group of 10 Above the Starting Count of 150 Passengers
Number of Ticket
Passengers Price Gross Fixed Cost Profit
150 $ 20.00 $ 3,000.00 $ 2,500.00 $ 500.00
160 $ 19.50 $ 3,120.00 $ 2,500.00 $ 620.00
170 $ 19.00 $ 3,230.00 $ 2,500.00 $ 730.00
180 $ 18.50 $ 3,330.00 $ 2,500.00 $ 830.00
190 $ 18.00 $ 3,420.00 $ 2,500.00 $ 920.00
200 $ 17.50 $ 3,500.00 $ 2,500.00 $ 1,000.00
210 $ 17.00 $ 3,570.00 $ 2,500.00 $ 1,070.00
220 $ 16.50 $ 3,630.00 $ 2,500.00 $ 1,130.00
230 $ 16.00 $ 3,680.00 $ 2,500.00 $ 1,180.00
.
.
.
430 $ 6.00 $ 2,580.00 $ 2,500.00 $ 80.00
440 $ 5.50 $ 2,420.00 $ 2,500.00 $ -80.00
450 $ 5.00 $ 2,250.00 $ 2,500.00 $ -250.00
Maximum Profit $ 1,280.00
Maximum Profit Ticket Price $ 14.00
Maximum Profit Number of Passengers: 270
Run Another Contract (Y or N): Your cruise ship, the S.S. Rusty T. Buckette, hires out for dinner party cruises.
Example:
A fund raising committee has agreed to pay you $30.00 per person provided that a minimum of 200 people sign up for a moonlight dinner dance cruise. Anxious for business (and to pay your crew), you agree to lower your price by 50 cents per ticket for EACH additional group of 10 people showing up over the minimum of 200. For example:
200 people Ticket Price is $30.00
210 people Ticket Price is $29.50
220 people Ticket Price is $29.00
230 people Ticket Price is $28.50
The ship's maximum carrying capacity is 500 passengers. You will incur a fixed cost of $2,500.00 no matter how many people show up. Your program should allow the following:
Allow user to start loop at any number of passengers from 1 to 500, subject to the maximum carrying capacity of 500 Allow user to select an ending number of passengers (ending must be greater than start but less than or equal to 500, maximum carrying capacity). Examples are user starts at 50 ends at 450, 20 ends at 230, start at 300 ends at 400) Compute the ticket price and profit for each group of passengers from your starting such as 1, 50, 200, 210, 220, 230, 240, 250, ... to your ending, such as 490, 500, Determine the maximum PROFIT, the number of passengers needed to generate that profit, and the ticket price that will generate that profit. Allow the program user (...that's you) to enter the proposed initial ticket price, the minimum passengers, the maximum number of passengers for this particular cruise. Calculate the ticket prices and profit for each group of passengers. The loop will execute a different number of times during the execution (Use a function to contain the calculations and resulting output?) For every group of 10 passengers, the ticket price is discounted by 50 cents. User can execute this any number of times. Logic should ask user if they wish to quit or continue.
Algorithms needed:
NP is the Number of Passengers
TP is the Proposed Ticket Price
MP is the Minimum Number of Passengers
Cost of Ticket = TP - (((NP - MP) /10) * .5)
Profit = (NP * Cost of Ticket) - 2500
Example of Input and Output
1 of 3 - Enter the minimum number of passengers: 150
Minimum Number of Passengers is set to 150
2 of 3 - Enter the maximum number of passengers: 450
Maximum Number of Passengers is set to 450
3 of 3 - Enter the Ticket Price: 20
Passenger Run from 150 To 450 with an initial ticket price of $20.00 with a fixed cost of $2,500.00
Discount per Ticket of $0.50 for each group of 10 Above the Starting Count of 150 Passengers
Number of Ticket
Passengers Price Gross Fixed Cost Profit
150 $ 20.00 $ 3,000.00 $ 2,500.00 $ 500.00
160 $ 19.50 $ 3,120.00 $ 2,500.00 $ 620.00
170 $ 19.00 $ 3,230.00 $ 2,500.00 $ 730.00
180 $ 18.50 $ 3,330.00 $ 2,500.00 $ 830.00
190 $ 18.00 $ 3,420.00 $ 2,500.00 $ 920.00
200 $ 17.50 $ 3,500.00 $ 2,500.00 $ 1,000.00
210 $ 17.00 $ 3,570.00 $ 2,500.00 $ 1,070.00
220 $ 16.50 $ 3,630.00 $ 2,500.00 $ 1,130.00
230 $ 16.00 $ 3,680.00 $ 2,500.00 $ 1,180.00
.
.
.
430 $ 6.00 $ 2,580.00 $ 2,500.00 $ 80.00
440 $ 5.50 $ 2,420.00 $ 2,500.00 $ -80.00
450 $ 5.00 $ 2,250.00 $ 2,500.00 $ -250.00
Maximum Profit $ 1,280.00
Maximum Profit Ticket Price $ 14.00
Maximum Profit Number of Passengers: 270
Run Another Contract (Y or N):
Explanation / Answer
ScreenShot
------------------------------------------------------------------------------------------------------------------------------------
Program:-
boolean="true" #variable for yes /no execution
#if yes then again execute , otherwise quit
while boolean=="true":
#user input
min=int(input("1 of 3 - Enter the minimum number of passengers: "))
max=int(input("2 of 3 - Enter the maximum number of passengers: "))
price=int(input("3 of 3 - Enter the Ticket Price: "))
#variables foe calculation
x=min
Profit=0
costOfTicket=price
FixedCost=2500
maximumProfit=0
maximumProfitTicketPrice=0
maximumProfitNumOfPassengers=0
#table heading
print(" NumberOfPassengers CostOfTiCket Gross FixedCost Profit")
#check input between 1 to 500
if x>0 & x<=500:
#print all table values
while x <=max :
costOfTicket = price - (((x - min) /10) * .5)#ticket cost calculation
gross=costOfTicket*x #gross claculation
Profit = (x*costOfTicket)-2500#profit calculation
#find maximum profit
if maximumProfit<Profit:
maximumProfit=Profit
maximumProfitTicketPrice=costOfTicket
maximumProfitNumOfPassengers=x
#print table values in each iteration
print(" ",x," ",costOfTicket," ",gross," ",FixedCost," ",Profit)
x+=10
#print maximu profit values
print(" Maximum Profit = ",maximumProfit)
print(" Maximum Profit Of Ticket price = ",maximumProfitTicketPrice)
print(" Maximum Profit Number Of passengers = ",maximumProfitNumOfPassengers)
#ask user to continue or not
prompt=input(" Run Another Contract (Y/N) :")
#if y continue otherwise break
if prompt=="y":
boolean="true"
else:
boolean="False"
---------------------------------------------------------------------------------------------
Note:-
I am using visual studio 2017.
If any query , let me know
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.