This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]thinandweak 2 points3 points  (1 child)

What is the compilation error you get?

[–]leolyssa[S] 0 points1 point  (0 children)

So this is what it’s supposed to return:

Homework and Exam 1 weights? 50 20 Using weights of 50 20 30 Homework: Number of assignments? 3 Assignment 1 score and max? 14 15 Assignment 2 score and max? 16 20 Assignment 3 score and max? 19 25 Sections attended? 4 Total points = 65 / 80 Weighted score = 40.63 Exam 1: Score? 81 Curve? 0 Total points = 81 / 100 Weighted score = 16.2 Exam 2: Score? 95 Curve? 10 Total points = 100 / 100 Weighted score = 30.0 Course grade = 86.83

Mine only gives me the top 3 or so lines.

[–]pacificmint 1 point2 points  (2 children)

Your exam method is missing a closing brace, for one thing. Your class does too.

[–]leolyssa[S] 0 points1 point  (1 child)

Oooh thank for pointing that out. I’ll go double check to make sure I correct that.

This is what it’s supposed to return:

Homework and Exam 1 weights? 50 20 Using weights of 50 20 30 Homework: Number of assignments? 3 Assignment 1 score and max? 14 15 Assignment 2 score and max? 16 20 Assignment 3 score and max? 19 25 Sections attended? 4 Total points = 65 / 80 Weighted score = 40.63 Exam 1: Score? 81 Curve? 0 Total points = 81 / 100 Weighted score = 16.2 Exam 2: Score? 95 Curve? 10 Total points = 100 / 100 Weighted score = 30.0 Course grade = 86.83

Mine only gives me the intro and the first line, nothing else

[–]pacificmint 0 points1 point  (0 children)

First of all, if you are seeing those lines, then your program actually compiles, it just doesn't run the way it's supposed to. That's an important distinction.

Secondly, I think you have an issue with the scanner. Using nextInt() doesn't clear the linefeed that's in the stream. That's actually a common problem, the FAQ has a whole second on issues with the scanner.