It's UWAweek 42 (2nd semester, week 12)

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 the 4 articles in this topic
Showing 4 of 738 articles.
Currently 51 other people reading this forum.


 UWA week 36 (2nd semester, mid-semester break) ↓
SVG not supported

Login to reply

👍?
helpful
1:16pm Fri 6th Sep, ANONYMOUS

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?


 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.


 UWA week 40 (2nd semester, week 10) ↓
SVG not supported

Login to reply

👍?
helpful
10:13pm Thu 3rd Oct, ANONYMOUS

Could I clarify my out.txt results as I am not sure if what I have done is correct. in.txt 0 1 2 3 0 1 2 3 0 1 2 3 out.txt 99, 4, 0, 99 99, 5, 1, 99 99, 6, 2, 99 99, 7, 3, 99 RAM Contents: 0,2,8; 0,2,8; 1,2,9; 1,2,9; 2,2,10; 2,2,10; 3,2,11; 3,2,11; 0,1,4; 0,1,4; 1,1,5; 1,1,5; 2,1,6; 2,1,6; 3,1,7; 3,1,7;


SVG not supported

Login to reply

👍?
helpful
7:39am Fri 4th Oct, Joshua N.

Correct

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