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.

Python question. Figure Q1. answer the following questions. Q1a. Describe and explain

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!