Designing our data tables
It's always a good practice to design with paper and a pencil before starting to program. If you do, you'll find that your code is much better because you'll contemplate scenarios that you may not see if you start programming right away, and, instead of hacking your way around what you have already programmed, you'll be able to design solutions beforehand. It's an easy investment that very often pays off, so that's what we will do in this section, we will design our data.
The basic variables
Let's start from the most simple scenario we can imagine and try to find any potential problems we may encounter. For each sale, we would like to have the following variables, the sales DATE
, the COST
for producing that type of food, the QUANTITY
bought, the PRICE
for the type food, whether or not we applied a DISCOUNT
, the macronutrient percentages for CARBS
(carbohydrates), PROTEIN
, and FAT
, the PROTEIN_SOURCE
of the food (either FISH
, CHICKEN
, BEEF
, or VEGETARIAN
, if the person...