This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
suzbo
wrote ...
2018/4/15
What does this variable evaluate to?
suzbo
2018/4/15
#
ro=(r>bts)?bts:r;
suzbo
2018/4/15
#
double ro=(r>bts)?bts:r;
danpost
2018/4/15
#
The variable
ro
is assigned the lesser of the two,
bts
or
r
. The statement is equivalent to:
double ro = 0; if (r > bts) { ro = bts; { else { ro = r; }
suzbo
2018/4/15
#
Thank you so much for that explanation.
You need to login to post a reply.
X