Some scientists were messing around in the lab. They cloned a cute bunny. What could possibly go wrong?
They created Bun Bun, a giant sentient bunny, with superpowers. Bun Bun saw how bunnies were being treated. He swore vengeance on humans, and become Evil Bun Bun the Destroyer. He's forced the scientists to work for him, preparing a clone bunny army.
Write a program to help Bun Bun work out how much food he'll need. You can download a starting worksheet.
There are two types of clones. Subbuns are his lieutenants. Minbuns are his foot soldiers. Here's what the worksheet looks like at the start.
Users type in the number of subbuns and minbuns, and the price per kilo of carrots. Each subbun needs 39 kilos of carrots. Each minbun needs 7.3 kilos.
Here's some sample output:
Validate all of the input. All inputs should be numbers that are greater than zero.
- Show errors to the right of each input cell, in red.
- If there is more than one error, show them all at once.
- Clear the errors and output each time the program runs.
For example:
Here some more errors.
You must use the flag pattern.
The usual coding standards apply.
Upload your worksheet.
(If you were logged in as a student, you could submit an exercise solution, and get some feedback.)