posted 8 years ago
So I'm back, after a 4am night last night and no result on this assignment! Basically I'm doing the driver exam assignment. Our teacher provides demo program that allows driver input of answers and displays result. We have to write the class that includes a method to return # of correct, # of incorrect and an array of the numbers of the questions missed. I struggled with this like crazy yesterday, trying to work out how to return the numbers of the unanswered questions when validation in the demo didn't allow unanswered. My teacher has now clarified, that by 'array of questions missed' he actually means 'an array of incorrect questions'. So to sum up - I need to write a class that provides # of correct, pass/fail, # of incorrect and a list of the question numbers pertaining to those incorrect answers. So far I have the total correct working, the pass/fail working and the total incorrect count working, but I just really don't understand arrays well enough (despite reading every forum between here and the moon) to understand how I can return the list of question numbers of incorrect - Please someone help me, I'm ready to throw my computer at a wall and give up this degree. I'm just an absolute complete beginner and just need a little help please. Those of you I spoke to yesterday understand!
Below is my class, for which I am getting the error 'compatible types, int cannot be converted to integer - return missed' - I think this means I need some sort of else statement but I've tried that and get a handful of extra errors. Below my class is the teacher's demo, and no matter what I do, I can't run it without getting the error 'incompatible types int cannot be converted to int[] missedQuesions = exam.Missedquestions().
This may seem the dumbest thing in the world to you, and I'm sorry if it's wasting your time, but I'm at my wits end!
Demo which also gets that conversion error listed above