Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program birthday_candles.py that computes how many boxes of candles a person needs to buy each year for her his birthday cake. You can

image text in transcribed

Write a program birthday_candles.py that computes how many boxes of candles a person needs to buy each year for her his birthday cake. You can assume that the person reaches an age of 100, the number of candles used each year is the same as the age, that you save non-used candles from one year to another, and that each box contains 24 candles. Also, at the end, we want you to print the total number of boxes one has to buy, and how many candles that are available after having celebrated the 100th birthday. An example of an execution: Before birthday 1, buy 1 box(es) Before birthday 7, buy 1 box(es) Before birthday 10, buy 1 box(es) Before birthday 12, buy 1 box(es) Before birthday 14, buy 1 box(es) Before birthday 95, buy 3 box(es) Before birthday 96, buy 4 box(es) Before birthday 97, buy 5 box(es) Before birthday 98, buy 4 box(es) Before birthday 99, buy 4 box(es) Before birthday 100, buy 4 box(es) Total number of boxes: 211, Remaining candles: 14 Notice: In our example we only have a print-out of those birthdays where you must buy boxes. In the non-printed years (e.g. 2-6 and 8- 9) you can handle the birthdays without having to buy any more candles

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago