Question: need fixed in pytyon code: import math class ticket: _ _ ticketType: str _ _ baseCost: float _ _ discountAmount: float _ _ geniePlusCharges: float
need fixed in pytyon code:
import math
class ticket:
ticketType: str
baseCost: float
discountAmount: float
geniePlusCharges: float
totalCost: float
def initself name, basecst:
self.ticketType name
self.baseCost basecst
self.calcdiscount
self.calcgeniepluscharges
self.totalticketcost
def calcdiscountself:
YesNo inputIs guest udner ten years old or a veteran of the US Armed Forces?:
if YesNoy:
self.discountAmount baseCost
else:
self.discountAmount
def calcgeniepluschargeself:
YesNo inputWould you like to add Genis Plus to your ticket for $
if YesNoy:
self.geniePlusCharges self.tickettype
else:
self.geniePlusCharges
def calctotalticketcostself:
self.totalTicketCost self.baseCost self.discountAmount self.geniePlusCharges
def printticketself:
printfselfticketType:selfbaseCost:fself.discountAmount:fselfgeniePlusCharges:fselftotalTicketCost:f
@property
def ticketTypeself:
return self.ticketType
@property
def baseCostself:
return self.baseCost
@property
def discountAmountself:
return self.discountAmount
@property
def geniePlusChargesself:
return self.geniePlusCharges
@property
def totalCostself:
return self.totalCost
tickets
def main:
another y
while another.lowery:
printWelcome to Disnyland!"
printPlease select your ticket type:"
printDay Single Park Ticket: $
printDay Hopper Ticket: $
printDay Single Park per Day Ticket: $
printDay Hopper Ticket: $
selection intinputYour selection
if selection :
name Day Single Park Ticket"
basecst
elif selection :
name Day Hopper Ticket"
basecst
elif selection :
name Day Single Park Ticket"
basecst
elif selection :
name Day Hopper Ticket"
basecst
tickets.appendticketname basecst
another inputAdd another ticket to your order? yn:
print
YOUR ORDER:
print:::::formatBASE COST", "DISCOUNT", "GENIE "TOTAL COST"
print
grandTotal
for o in tickets:
oprintticketType
grandTotal grandTotal ototalCost
printf
Your order total: $grandTotal:f
print
Enjoy your stay at Disneyland, the happiest palce on earth!"
if namemain:
main
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
