Problem Solving / Programming Design Exercise 1: 21.11.2021 16:30 UTC
Hello Everybody,
last week we have finished our Practical Python journey.
I had the pleasure to join a full week course "Advanced Programming in Python" (https://www.dabeaz.com/advprog.html) and have brought some inspirations from the course with me that I want to share with you.
The exercise is from this book: How to Design Programs 2nd Edition (online available for free)
Here is the problem description:
Let's solve this problem and discuss our design and our solutions
The session will start at 16:30 UTC (http://time.unitarium.com/utc/16).
Here is the session link: https://meet.jit.si/practical_python_programming
CU soon
Alex
last week we have finished our Practical Python journey.
I had the pleasure to join a full week course "Advanced Programming in Python" (https://www.dabeaz.com/advprog.html) and have brought some inspirations from the course with me that I want to share with you.
The exercise is from this book: How to Design Programs 2nd Edition (online available for free)
Here is the problem description:
"The owner of a monopolistic movie theater in a small town has complete freedom in setting ticket prices. The more he charges, the fewer people can afford tickets. The less he charges, the more it costs to run a show because attendance goes up. In a recent experiment the owner determined a relationship between the price of
a ticket and average attendance.
At a price of $5.00/ticket, 120 people attend a performance. For each 10-cent change in the ticket price, the average attendance changes by 15 people. That is, if the owner charges $5.10, some 105 people attend on the average; if the price goes down to $4.90, average attendance increases to 135.
Unfortunately, the increased attendance also comes at an increased cost. Every performance comes at a fixed cost of $180 to the owner plus a variable cost of $0.04 per attendee.
The owner would like to know the exact relationship between profit and ticket price in order to maximize the profit.
Write a program to figure out the best ticket price (to the nearest 10 cents) that maximizes profit."
Let's solve this problem and discuss our design and our solutions
The session will start at 16:30 UTC (http://time.unitarium.com/utc/16).
Here is the session link: https://meet.jit.si/practical_python_programming
Alex
Comments
I will come as soon as possible, you can start with the problem design if I come late.
cu soon,
alex