There is a zipped project in the files section for you. It does not compile. Your job is to implement the Farm class so that it does. That's it. The functionality is indeed as easy as it sounds so don't overthink it. It's just storing and retrieving data (Get and Set paradigm), but it shows how an object can store multiple pieces of data and persist across method calls.
- Look at the methods I call on Farm. Make those prototypes in the Farm h file.
- (Being able to turn code back in to a prototype is a last week topic.)
- Think about what data the farm needs to be able to keep track of. Make those properties in the h file.The point is what if there were multiple farms? You'd want each one to store its own name. Just like each rock gets its own weight.
- Remember that you can't use the same name for two variables in the same scope. This is why there are code styles. If you start all of your properties with an underscore, for example, you'll never be confused if a variable is local or a property.
- Farm.cpp should have no cout statements. Main is printing all of the results of Farm's methods.
- There is a HUGE difference between a property and a method. Parenthesis mean function/method.
"I need to be able to plant potatoes, so I need a property to track how many potatoes I have."
7.11 in the book explains h files. "Focus on Software Engineering: Separating Class
Specification, Implementation, and Client Code"
7.4 explains get and set. "Creating and Using Objects"
Capitalization counts.
Remember to read the announcements about turning in homework and using external projects.
Part of this assignment is being able to turn in a project with multiple files. You can right click a project in VS and rightclick->OpenFolderInExplorer. Go in to that folder and delete the Debug folder. Zip the project folder with no Debug folder inside. To zip a folder, you just right click it and pick "SendTo->CompressedFolder". (If you don't have a debug folder, it means you aren't using a solution correctly. Delete the hidden folder ".vs" instead.)
Don't try to be clever and use rar or 7z or zipx or anything else. It doesn't matter if other compressed formats make the resulting folder smaller. What is important is that zip is built in to every OS, and the others aren't. When you have a job and need to send an important file to your boss, if you 7z it they won't be able to open it. And they will fire and/or beat you.