hi all, im new to this forum and to java, yeah i know you probably hat newbies by now. Anyway i am trying to get to grips with java and have stumbled accross a real biyatch of a problem. ive designed a multiple choice quiz which has a set of questions pre programmed, now, you can run the quiz and it will give you a mark at the end of it (there are only 4 simple questions at the mo.). All iwant to do is make it so that i can add questions and possible answers and save them to disk. So i can load up different quiz'. Sounds easy enough, however like i said im a newbie and im trying to get to grips with serialization. i was wandering if anyone did java for kicks and wanted to have a kick at mine or i'll kick my prescious ibook. Im sure it would take some of you 10 mins if that?
[EJFH: Invitation to take this offline deleted.]
i would greatly appreciatte any help.
P.S im not just trying to get the program working ideally i would like to understand it quite well......
Kind Regards, John Carter [ April 14, 2005: Message edited by: Ernest Friedman-Hill ]
We're happy to help, but part of the bargain is that other people have to be helped, too. So instead of taking this offline, you have to let us work though things in public. Why not show us what you have so far, and tell us what's broken or where you're stuck, and I'm sure you'll get some good advice. Please use [ CODE][ /CODE] tags around any code you post to preserve formatting (remove the spaces.)
The QuizCardBuilder.saveFile() method opens a file, writes two strings into it for each card, and closes the file. As far as it goes, it looks OK. You might want to use PrintWriter instead of BufferedWriter, and println() instead of write(), to put each String on its own line.
So what do you want to do next? I note you've asked about serialization, but you're not using that here, nor would it be an especially good idea to do so in this application.
well the Quizcardbuilder class, isnt r eally my code, ive implemented it from a book and tried to get it to work for me. I know its a lot of code but im stuck in a rut and cant seem to get anywhere. The error comes from the array in QuizCardbuilder. If you try running it it doesnt work.
All i want to do is create a class that will allow me to to add questions to my quiz and then bring them back up. Basically add different quiz questions. If you could take a look at this i would be ever so gratefull to any1 who can help. I just cant seem to get it working at all.
please please please, im sure theres java freaks that would get their kicks out of solving this.... i hope. i wanna be one of those geeks.
Well, if you really want to learn, then cobbling something together patchwork that you don't understand isn't the way to do it. You need to take a step back and do a little reading and write a few simpler little programs first, so that you understand the relevant parts of the program.
Sun's online Java Tutorial is excellent. In the early parts (called 'trails') you'll get a tour of all the important APIs, including I/O stuff. If I were you, I'd plan on spending a dozen hours going through all of the " Trails Covering the Basics" parts, working the examples, making sure you understand them. By the time you get through, you'll be able to fix this program up by yourself straight away!
im in the process of learning it all, reading books, java.sun, and i do understand it as i go along but in terms of the problem im now trying to solve its a bit too much for me but would like to get it sorted.....Thanx
A day job? In an office? My worst nightmare! Comfort me tiny ad!
how do I do my own kindle-like thing - without amazon