I have a homework assignment, and I don't expect people on the board to do it for me, but I do need some advice on how to begin. Should I load all the data into one array? Also, what would be the best way to put the final output in alphabetical order?
I am also having trouble figuring out how to assign values of 0 for letters that don't exist in the file.
"Problem: There exists a series of zones labeled A through Z. A number of properties (all rectangular in shape) are assigned to a zone and have a length and width (in feet, assume integer data). You will write a program that will load data from a file named zones and display the total area (in square feet) for each zone.
Example zones file:
A 3 3
B 2 2
A 3 1
C 2 2
D 3 10
Z 1 9
Example output (to the monitor):
A = 12 B = 4 C = 4 D = 30
E = 0 F = 0 G = 0 H = 0
I = 0 J = 0 K = 0 L = 0
M = 0 N = 0 O = 0 P = 0
Q = 0 R = 0 S = 0 T = 0
U = 0 V = 0 W = 0 X = 0
Y = 0 Z = 9
In this example only the zone A had multiple entries, but it is possible for some zones to have multiple entries and others have none.
You donít need to validate any input, you can assume all data to be in the zones file to be valid.
Format the output to print only four zones per line separated by the tab character."