Reflection: Variables
After researching about variables, I have learned somethings.
I, Summary
- A variable is a name reference to a memory location, holds data that can change in value during the lifetime of the variable.
- How to use variable
II, Applied to solve problems
There are some question from my teacher to check my knowledge.
1.Change data types and operators in the demo (done in class)
2. Convert C to F.
°C x 9/5 + 32 = °F
3. Convert meter to feet:
ft =m * 3.2808
4. Calculate the area of a square when we know an adjacent edge.
5. Calculate the area of the rectangle when we know width and length.
6. Calculate the area of right triangles we when know 2 adjacent sides
III, Some of my thoughts
This is a mind map about variable.
When I code, I have some mistakes. Firstly, forgetting & before variable, then the variable doesn't have value. Secondly, when I type s =1/2*a*b, then s =0(!). So I edit it to become a*b/2, s != 0. I think the progammer should be think careful before write a code, consider that using what variables be suitable with the program!
Comments
Post a Comment