#Correctly making a script that takes two numbers and outputs the division result

18 messages · Page 1 of 1 (latest)

rapid swanBOT
#

This post has been reserved for your question.

Hey @tepid maple! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

granite void
#

% is the remainder operator:

#

/run

System.out.println(5 % 3);
south baneBOT
#

Here is your java(15.0.2) output @granite void

2
granite void
#

but you could also compute it from the division result

rapid swanBOT
#

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.

granite void
#

look at the highlighting behind Q2

#

look where it stops

#

you have an extra closing brace

#

btw, "numerator" and "denominator" are terms used in fractions, for plain division you might want "dividend" and "divisor"?

#

first off, the method for getting ints from input is nextInt

#

from there you'll be using things that exist, but incorrectly

#

println doesn't return anything, it just.. prints

#

nextInt doesn't take a string argument for a message, it just reads input

#

if you need to show a message then get input, then you need to println then nextInt

#

and that's just for a single value

rapid swanBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.