A class system that represents produce available at a farmer's market.
I wrote this for a job I applied to in 2021. Though underwhelming, this code achieved its purpose of securing my first software position as an Entry-Level Dev.
I won't be accepting changes to this project, as it represents years of hard work and challenges faced finally starting to come together.
Requirements are listed in FarmersMarket.pdf
Market declared with stand objects:
Farmer Name: Farmer 0
Stand Name: Stand 0
Number of Apples: 0
Number of Tomatoes: 0
Number of Melons: 0
Number of Carrots: 0
Number of Broccoli: 0
Farmer Name: Farmer 1
Stand Name: Stand 1
Number of Apples: 0
Number of Tomatoes: 0
Number of Melons: 0
Number of Carrots: 0
Number of Broccoli: 0
Market with updated fields:
Farmer Name: Farmer Bwennin
Stand Name: Bwennin's Produce
Number of Apples: 1
Number of Tomatoes: 0
Number of Melons: 5
Number of Carrots: 0
Number of Broccoli: 3
Farmer Name: Farmer 1
Stand Name: Stand 1
Number of Apples: 2
Number of Tomatoes: 0
Number of Melons: 0
Number of Carrots: 1
Number of Broccoli: 0
Output of findProduce():
Invalid produce. Try again using a, t, m, c, or b as an argument.
No farmers have this item.
Farmer Bwennin has apples at Bwennin's Produce.
Farmer 1 has apples at Stand 1.
Output of buyProduce():
q is not a valid purchase. Try again using a, t, m, c, or b as an argument.
Farmer Bwennin has no carrots.
You bought one apple from Farmer Bwennin. Farmer Bwennin now has 0 apple(s).
You bought one apple from Farmer 1. Farmer 1 now has 1 apple(s).
Market after buying produce:
Farmer Name: Farmer Bwennin
Stand Name: Bwennin's Produce
Number of Apples: 0
Number of Tomatoes: 0
Number of Melons: 5
Number of Carrots: 0
Number of Broccoli: 3
Farmer Name: Farmer 1
Stand Name: Stand 1
Number of Apples: 1
Number of Tomatoes: 0
Number of Melons: 0
Number of Carrots: 1
Number of Broccoli: 0