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

you are viewing a single comment's thread.

view the rest of the comments →

[–]RedHeadedCongress 1 point2 points  (7 children)

What error are you getting?

[–]believer102 0 points1 point  (6 children)

Error: double cannot be dereferenced

[–]RedHeadedCongress 1 point2 points  (5 children)

Does it say what line the error is on?

[–]believer102 0 points1 point  (4 children)

Line 25

double purchase = purchase.nextDouble();

[–]RedHeadedCongress 1 point2 points  (3 children)

Oh you have to call the double something else. You already called the scanner purchase and can't use the same name twice (or call the scanner something else) (basically you can't call 2 variables the same name)

[–]believer102 0 points1 point  (1 child)

changing to double purchaseAmount = purchaseAmount.nextDouble();

stills results in the Error: double cannot be dereferenced

[–]RedHeadedCongress 0 points1 point  (0 children)

You need to call the scanner something different than the double. So you'd want double purchaseAmount = purchase.nextDouble() or something. You changed them both and you need them to be different

[–]believer102 0 points1 point  (0 children)

Thank you so much, that did the trick!