Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions