Hello guys, I made the coding in the screen shot to try out this java problem. I personally think it would work fine and perfectly when run but I do not have access to the methods and cannot run this in a console. Its FRQ number 1 question b and heres the link to the FRQ: https://apcentral.collegeboard.org/media/pdf/ap22-frq-computer-science-a.pdf
#Java, do you think this code works? AP CSA FRQ
1 messages · Page 1 of 1 (latest)
<@&987246883653156906> please have a look, thanks.
This is what collegeboard put as the finished product and answer of the FRQ. I'm thinking that my coding is the same but just a bit more smaller but I am not sure since sometimes code tends to not work because of a fault or mistake.
Your code will not work because play returns void so when you do play().getScore() you are attempting to call a method on nothing
Also assuming play has side effects, you are calling it twice and the second call may have different results from the first
Your question has been closed due to inactivity.
If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.
Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.
When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.
Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.
With enough info, someone knows the answer for sure 👍