Landing : Athabascau University

Unit 4

Last updated May 21, 2022 - 11:26am by William Henman

I started reading the fourth Unit. Firstly, I finally understood the main() method, with the argument String[] args which is an array of Strings named args. It made more sense looking at it that way since I could not understand why they used that initially. Since I learned a bit about subroutines on my own by doing a bit of research, I already understood the general syntax of a method. Although, I found it useful to know that a Public subroutine could be used only in its package, while a Private subroutine could be used only in a class. I also learned a bit more about how to use variables, and how to use them as local variables inside parameters or using them to place inside the subroutine as a parameter. I had a little trouble with that before reading this unit, which helped me work back on the assignment. I ended up turning the input value into a global variable! Feels good to keep learning and it is starting to feel like coding will be a long-time passion of mine. I had no particular reason to change the code other than to apply what I had learned to my assignment. Return is interesting but with Python, I already worked with this. This course is a lot more object-oriented and class-oriented as I can see and I see the effect of this through the global variables and working with classes, which I didn't get the chance to do with python in my course (I learnt about OOP in Python on my own by searching through the internet). I felt the styling of variables to be a bit useless, I don't really see the meaning of using different styles for different types of variables, like-named constants or regular variables. Like using fully upper cases and an underscore to name named constants. I'm definitely going to be using the "var" now, since the computer sort of "decides" what variable it ends up being. Like saying, "var num = 0.05" would turn the num variable into a type double, with the value of 0.05. This means when I'm not sure which type to use, I can simply use the var and the computer will sort of know. Also, the scope rules were sort of obvious to me, since Python had its own scope rules. Working on the mosaic problem was a fun way to approach creating subroutines for your program. I felt like I could easily position myself doing the same thing, seeing what tasks are necessary to do, and creating subroutines to accomplish those tasks, and having subroutines using other subroutines as well. 

Comments

These comments are moderated. Your comment will not be visible unless accepted by the content owner.

Only simple HTML formatting is allowed and any hyperlinks will be stripped away. If you need to include a URL then please simply type it so that users can copy and paste it if needed.

(Required)

(Required)