A. Introduction
When programming, you will see an expression like x=x+1 quite often. More similar cases are y=y/4 or z=z*0.125. This is all because " = " has a different meaning in coding. Instead of "equals", it means "assignment". i.e. Assigning the RIGHT hand side of the equation to the LEFT hand side of the equation. In this case, x=x+1 means increasing x by 1 and assigning the value back to x.
Similarly, y=y/4 means reducing y value to 1 quarter of the original. z=z*0.125 means multiplying original z by 0.125 and assigning the product back to z.
As a matter of fact, this type of operations are so frequently used, that we have shortcut operators just for the purpose:
C. Try the following:
D. Kahoot!
E. HW
https://www.codiva.io/p/8292b7b5-cb8c-4fa0-9612-c86a010732ca
you can't put R4 into codiva because there are undefined variables
We will go through this together in the class today
R2=0,
R3= Mystery has already been defined as an int so there's no need to define it again,
R4= I couldn't get this one bc it kept showing error all the time,
R1= a=int, constant. c=int, constant. b=float int. d=float int.
R2 = 0
R3 = because you've already defined mystery as a int so you don't have to define it again
R1 = a and c are constants, they are also integers, b and d are floating-point numbers
R4 = m * ( √ (1 + v / c) / √ (1 - v / c) - 1) = dm, π * r * r * h = volume, 4 * π * r^3 / 3 = volume, √ (x^2 + y^2) = z
mystery can't add by 1, and that's on both 2 and 3... For R1, a and c are constants, and b and d aren't.R1 and R4 is confusing, and I'm scratching my head, Because it shows Error, when I press run.
R2 and R3 have the same problem; it must be mystery == mystery +1 to tie it back to mystery. R1 and R4 seems confusing.
Looks like I'm back a year later. Welp. Time to do this again.