CS #2: Intro to C / C++ / C#

Learn C# fundamentals

  1. 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.
  2. Data Types
    • String or char
    • Numbers: int, float, double, decimal
    • boolean (true or false)
    • And more...Such as structs, arrays, etc
  3. DeclaringThis variable will take up storage space in memory. variables (or data types)
  4. IF-ELSE statement
    • Conditional statement. Do something only if it meets condition.
  5. Math Operators
    • + - * /
    • %Module operator.
      A = 10 and B = 20. B % A = 0
    • ++ or --Increments or decrements. Commonly used in loops.
  6. Relational OperatorsWhen comparing 2 variables.
    • ==
    • !=
    • > or <
    • >= or <=
    • You can even use "&&" or "||" for multiple comparisons.
  7. 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.?
  8. 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.?
  9. Let's go over some examples
    • Attach example files here