A programmer writes a program to weigh baskets of fruit in grams, keeping a total of the weight and counting the number of baskets. The total weight is stored in a variable Total and the number of baskets is stored in a variable BasketCount. Explain, including examples of programming statements, how totalling and counting could be used in this program. Totalling Counting
- TotallingExplain, including examples of programming statements, how totalling could be used in this program.[2]
- CountingExplain, including examples of programming statements, how counting could be used in this program.[2]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2019). The mark or mark type is shown in brackets.
- [4] Totalling:
- ∞ Adding the weight of each basket to the total weight as each weight is entered
- ∞ Total = Total + Weight
- Counting:
- ∞ Adding one to/incrementing the number of baskets as each weight is entered
- ∞ BasketCount = BasketCount + 1
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →