Computer Science Canada Need so help with my java homework |
Author: | SHOPPINGGIRL11 [ Sun Apr 25, 2010 10:33 pm ] | ||
Post subject: | Need so help with my java homework | ||
Hey, for my homework I have to make a program that will read information from an answers key file. Store the information in an answer key array, the answers can only be a,b,c,d. The program will then read the information from a student answer file, in this file there will be the number of students on one line then the name of the student followed by the students 10 answers. Everything is on its own line in the file. The program will store the marks in an array. For each student compaire the answers, keep a count of correct answers and output the student name, state if each answer is correct or incorrect and the total correct score. Ok so right know I have read the answer key file and stored the variables in an array.
I am having trouble reading from the second file, I have never read from 2 diffrent files in the same program before so I keep getting an error. Also I was wondering how to read the diffrent types of information in the sudent answers file should I use 3 variables to do that one array of chars for the answers, a string variable for the name and a int variable for the number of studnets in a file? As you can see in my code tht is what I have attempted to do.. didnt work out so well Thank you for your help in advance! |
Author: | wtd [ Sun Apr 25, 2010 11:59 pm ] |
Post subject: | RE:Need so help with my java homework |
First things first... Java won't compile a class with duplicate local variables. |
Author: | Barbarrosa [ Mon Apr 26, 2010 4:40 am ] | ||
Post subject: | Re: Need so help with my java homework | ||
wtd's right. You can assign a different object reference value to a variable, but that does not entail declaring its type again.
|