It's UWAweek 16 (1st semester, week 7)

help2005

This forum is provided to promote discussion amongst students enrolled in CITS2005 Object Oriented 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.

How do I ask a good question?
Displaying selected article
Showing 1 of 49 articles.
Currently no other people reading this forum.


 UWA week 11 (1st semester, week 3) ↓
SVG not supported

Login to reply

👍?
helpful
10:37am Tue 12th Mar, ANONYMOUS

In the recorded lecture from 2023 corresponding to lecture 4 there was some code that was demonstrated to show how each time a for loop iterates, the variables are re-initialised. I was curious about what would happen if a global variable were used instead. Could you explain why I got the output I got in regards to scope and re-initialisation, when I ran my version of the code? Here are two screenshots: the first being the demonstrated code and the second being my code.



This article has 2 attachments:

 

 

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  5:07AM Sep 06 2023
Privacy policy