It's UWAweek 47

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying selected article
Showing 1 of 828 articles.
Currently 99 other people reading this forum.


 UWA week 37 (2nd semester, week 7) ↓
SVG not supported

Login to reply

👍?
helpful
9:17pm Thu 12th Sep, Joshua N.

ANONYMOUS wrote:
> If an expression that is not a print is not inside a function's scope, would it be in the global scope? And if the print is outside of a function's scope, would it be located in the main function? > For example, the ml file: > > # 9 is printed > # > one <- 1.555 > one <- one + 2 > # > function increment value > return value + one > # > print increment(3) + increment(4) > > would be: > > float one = 1.555; > one = one + 2; > float increment(float value) { > return (value + one); > } > > int main() { > return 0; > } > > for the temp file?
If print appear outside a function in ml, then you put the print statements in main otherwise you'll get an error.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy