CS #2: Intro to C / C++ / C#
Learn C# fundamentals
- C++ / C# / Java is the programming language used in colleges. Why?
- It's complete.
- It's Object-Oriented Programming (not covered in this lesson).
- If you can learn C++, you can learn anything.
- Data Types
- String or char
- Numbers: int, float, double, decimal
- boolean (true or false)
- And more...Such as structs, arrays, etc
- DeclaringThis variable will take up storage space in memory. variables (or data types)
- IF-ELSE statement
- Conditional statement. Do something only if it meets condition.
- Math Operators
- + - * /
- %Module operator.
A = 10 and B = 20. B % A = 0
- ++ or --Increments or decrements. Commonly used in loops.
- Relational OperatorsWhen comparing 2 variables.
- ==
- !=
- > or <
- >= or <=
- You can even use "&&" or "||" for multiple comparisons.
- IterationRepeating a step until it finds the answer
- Counter-ControlledWhen you know exactly how many times the code will execute.
- For loop
- While loop
- Do-While loop
- Event-ControlledExecutes as long as expression is true. Don't know how many times it will execute.
- While / Do While loop. Do you know the differenceA do-while loop executes (enters block of code) at least once.?
- MethodsOrganizes or declutters code.
- Return typeA method may return a value (string, int, etc). If not, then return type is void.?
- ParametersInside the parentheses. Optional.?
- Let's go over some examples
- Attach example files here