click below
click below
Normal Size Small Size show me how
Y1S2 Interactive #2
Week 2
| Term | Definition |
|---|---|
| Namespace | All C# code must belong to a namespace (think of it as a folder) |
| Main | Starting point of the program. Method that's run first. Puts the program together. static void Main(string[] args) |
| Static | Main must be static |
| Main characteristics | Static (mandatory), Void (returns nothing), Parameter (Not necessary) |
| The steps | Step 1 - Declare variables. Step 2 - Get values. Step 3 - Perform calculation. Step 4 - Display the result |
| x++ | Post increment. Use the old value |
| ++x | Pre increment. Use the updated value |
| Implicit casting | No data loss. Storing small memory into larger memory. int -> float -> double |
| Explicit casting | Storing something that needs more memory into something that is smaller memory. double -> float -> int. int(myDouble) |
| Operations | int [operator] int gives you an int. If you want a result that includes decimals, make sure one value is a double |
| Integer division | int/int gives you an int. If you want a result that includes decimals, make sure one value is a double |