heres the instructions, and im using jedit this is java 1 basic stuff just logic
Write a program that determines how many males and females live in each of the Zip Code areas in the Student Enrollment Records Set. Output the zip code, the total number of males, and the total number of females for each zip code. At the end of the report display a total of males and females.
There are 5 zip codes in the record set. The zip codes are : 53711, 53712, 53713, 53714, 53716. These zipcode values are self-evident as zipcodes, and may be used as literals within the program--they are an exception to the general course standard of avoiding the use of literals down in the main section of a program. As each record is read, interrogate the gender code field and the zip code field, and then increment any appropriate counter variables for that gender and for that gender and zipcode combination.
NOTE: This program MUST be set up so that it reads through the Student Enrollment records just ONCE, incrementing all appropriate counters as it goes. If it is written so that it reads through the Student Enrollment Records more than once, this Part 4 of Learning Unit 4 will automatically receive a deduction of -3 points, in addition to any other point loss due to standards, etc.
There must be at least four (4) functions in this program for full credit. The existing function named, project4Part4() is the first one. You must create at least three (3) new additional functions for the program. (These new functions must, of course, be located in the js library file associated with this program, and must follow course naming standards, etc.)
this is the sample output
53711: Males: 5 Females: 2
53712: Males: 9 Females: 9
53713: Males: 11 Females: 3
53714: Males: 4 Females: 6
53716: Males: 1 Females: 0
Total Males: 30
Total Females: 20
this is what i have so far it lists all the zipcodes in the record
function project4Part4() {
var currentZipCode;
var studentRecords;
studentRecords = openStudentEnrollmentRecords();
while (studentRecords.readNextRecord()) {
currentZipCode = studentRecords.getStudentZipCode();
document.write(currentZipCode + "<br />");
}
}
the part im not sure how to do is how do you make it read and record it all at once. i know its simple im just dont know how to make it read the whole record at once
please help
This post was edited by jsbb on Nov 11 2015 12:52pm