C# Basics Course Notes

Jul 11, 2024

C# Basics Lecture

Introduction

  • Instructor: Mike from Draft Academy
  • Course Overview: Comprehensive introduction to C# programming
  • Applications: Widely used in various software applications

Course Outline

  1. Setup
    • Installing C#
    • Installing Visual Studio
  2. Core Programming Concepts
    • Variables and Data types
    • Getting user input
  3. Advanced Topics
    • Loops, if statements, data structures
  4. Object-Oriented Programming
    • Classes and Objects
    • Inheritance
    • More advanced concepts

Setup

Installing Visual Studio

  • Website: visualstudio.com/vs/community
  • Options to download for Windows or Mac
  • Install .NET Desktop Development

Running Visual Studio

  1. Sign-in: Optional
  2. Pick Starting Options: Recommended general and blue theme
  3. Creating a New Project:
    • File --> New Project
    • Select Console App for C#
    • Naming and storing the project
  4. First Look at Visual Studio
    • Solution Explorer: project structure
    • program.cs: main program file

First Program

Understanding the Program Structure

  • using system; and other directives: importing namespaces
  • namespace, class Program, and static void Main: the structure and entry point of the program
  • Main Method: The primary method executed when program runs
  • Console.WriteLine: Printing to console; Console.ReadLine: Keeping console open until input

Writing First Program

  • `Console.WriteLine(