Question
Python question. Figure Q1. answer the following questions. Q1a. Describe and explain what the following statements are doing and what is the output. card1 =
Python question.
Figure Q1. answer the following questions.
Q1a. Describe and explain what the following statements are doing and what is the output.
card1 = MovieCard(70)
print(card1.tickets)
Q1b. The statements below will execute successfully, and output is shown.
card2 = HSBCMovieCard("Jeffery Tan", 100)
print(card2.tickets)
output -> 15
However, the output is not correct as $100 HSBC MovieCard should entitle to 18 tickets.
- Indicate which statement number(s) in Fiqure Q1 causes this wrong ticket entitlement.
- Explain why the error occurs and make correction(s) to the identified statement(s) to compute the correct ticket entitlement.
Q1c. There is a runtime error when executing the following statements below.
card1.tickets = 11
Explain why this runtime error occurs and make correction(s) to the part if it is possible to correct the error.
Q1d. Due to demand, there is a need to offer 5 tickets at $35 for MovieCard and 6 tickets at $35 for HSBCMovieCard.
Modify the program in Figure Q1, by adding appropriate method(s) such that the codes can easily cater to adding new offering or removing offerings.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started