Here are some problems for you to try. Solve them using file I/O, functions, arrays and recursion where necessary. A user friendly menu and documentation are important as well. These questions make good exam prep.
The student question, "Do I need OOP?" comes up often. That is your design choice. Some questions lend themselves to an OOP solution, others do not.
3 4 1
7 7 4
Each number indicates the quantity of pine trees per acre of land.
Reading the forest01.txt, we can understand that the forest is 6 acres in size, the forest is 2 x 3 in dimension. We also know that there are 26 pines in this forest.
The Sunny Day Forestry Management Tree Wardens keep detailed notes regarding how many trees can be harvested per acre. Their notes are held in files (notes_forest01.txt) in the following format:
1 3 0
6 1 2
Your application will load the forest file, output the data to the screen, provide a total count of trees and display the dimension of the forest in Row x Col format. Your application will also subtract the Tree Warden's data from the forest data. This will be saved to a file called harvested_forest01.txt and displayed to the screen:
2 1 1
1 6 2
SAMPLE RUN:
Opening: forest01.txt
3 4 1
7 7 4
Total tree count: 26
2 x 3 acre dimension
Opening: notes_forest01.txt
1 3 0
6 1 2
Calculating harvest:
2 1 1
1 6 2
Data has been saved to harvested_forest01.txt
Part A:
Part B: