Cthulhu's mother and sister sent it some goat soap, from Australia. It's made with goat milk. The soap, that is, not the continent. The continent is made of rocks, dirt, and beer.
Cthulhu likes the soap, and wants to make its own. However, it decides only to use milk from phlegmatic, kookie goats. It wants to know how much milk is available.
Cthulhu's minion, Pandush, is sent to gather the necessary data from Cthulhu's goaty friends. Write a program to figure out how much milk is available.
Here's some of the data Pandush gathers.
There are four fields for each goat:
- Name.
- Milk produced in gallons per day. Should be a number from 1 to 4. Anything else is invalid.
- Phlegmatism. Should be a number from 1 to 10. Anything else is invalid.
- Kookosity. Should be a number from 1 to 10. Anything else is invalid.
Unfortunately, Pandush is still on Dr Tooth Loosener's Blue Crystals of Fun. He might have made some mistakes when typing in the data.
Download the start workbook with the data. It looks like this:
Cthulhu will use milk from goats who meet the following criteria: phlegmatism and kookosity scores are both seven or greater.
Your program should output:
- The number of records, valid and invalid.
- The number of valid records, that is, the records that have valid data, whether or not they meet the phlegmatism and kookosity criteria.
- The number of records with invalid data.
- The number of valid records that meet the phlegmatism and kookosity criteria.
- The total milk from valid records that meet the phlegmatism and kookosity criteria (G14).
Cthulhu also wants one more count, for extra special Jenna-approved goats: the number of valid records that meet the phlegmatism and kookosity criteria, and they are particularly kookie (have kookosity of 9 or more). Why does Cthulhu want to know this? It won't say.
Your validation code should use case-wise deletion. If you don't remember what that is, check the lesson Filtering: invalid data. Or ask Pandush, if he's compos mentis.
Here's the output your code should produce.
Use a Range
object, and write the code so that it will work with no changes when new goat data is added. The usual coding standards apply.
Upload your work.