Ask coding questions

← Back to all posts
help me with classes
Firdavs02 (0)

We are learning Java classes and were assigned to write the math quiz we with classes. It's been only few months I've been learning Java, but i have big problems

a5rocks (774)

Have you tried going down the list of errors raised and solving each one?

E.g. by removing the third line of, adding another ending curly brace at the end of, etc.

Firdavs02 (0)

@a5rocks yeah, I have tried, but couldn't solve the error in question class. Thank you for help

a5rocks (774)

@Firdavs02 You don't end the getRandomQuestion function

Firdavs02 (0)

@a5rocks got you, now got 26 errors, sh*t

a5rocks (774)

@Firdavs02 xD yeah uh that seems like something to occupy your time...

Though once you get through those your code should work.

Firdavs02 (0)

@a5rocks can you check it now? I couldn't solve errors in grade class

a5rocks (774)

1) in Grade's getGrade function, you capitalize Grade instead of using grade.

2) in the class Grade, you use getLetterGrade instead of getGrade.

3) the grades should be strings (e.g. "A")

4) the initializer (factory, whatever it is called) tries to find the variable correct, but can't. Same for several other variables.

There might be more errors, but that's the gist of it.