Cake production planning


The Goat Cakes Squishing Company (GCSC) makes and sells goat cakes, for birthdays, sillydays, osmondays... goats celebrate all kinds of things.

Goat cakes aren't baked. They're made by squishing stuff together in powerful presses. There are two kinds of cakes:

  • Corn cakes
  • Oat cakes

GCSC has two retail stores, called North and South, and a central factory. The cakes are pressed in the factory, and sent to the stores.

Sometimes, customers order cakes ahead of time at the stores. So a goat might order two oat cakes for next week, from South. Other cakes are sold over-the-counter (OTC), as goats wander in from the street.

Write a production planning program, to estimate the number of cakes GCSC will need for the coming week. Your program should produce different output, depending on the data in the CSV files.

Each store emails a CSV file to the factory, with the number of corn and oat cakes customers have ordered for the week. For example, North might send this file:

  • 13,8

That would mean North has orders for 13 corn, and 8 oat. The file is always called north.csv.

South sends a similar file, called south.csv.

Your worksheet should start like this:


(You can download a starting worksheet.)

B7 and B8 show data read from north.csv. B11 and B12 show data read from south.csv.

B15 and B16 show estimates OTC for the week, for North and South added together.

  • For North, OTC is double the orders. So if corn orders for North are 10, estimated OTC will be 20. If oats orders are 8, estimated OTC will be 16.
  • For South, OTC is triple the orders (southern goats are more impulsive). So if corn orders for South are 10, estimated OTC will be 30. If oats orders are 8, estimated OTC will be 24.

The total for corn (B19) is North corn orders plus South corn orders plus OTC. Same for oats.

Here is some sample output:


Here's some output for different CSV data:

More output

Upload your solution. The usual coding standards apply.