{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e9b196ec-c4f1-49de-b318-f60f6d0e3e5b",
   "metadata": {},
   "source": [
    "# Preview Questions\n",
    "\n",
    "Complete these questions **before** class to prepare for the chapter.\n",
    "Use the dropdowns to check your answers.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ed986115-eac6-4a9b-875e-bdfd370ff060",
   "metadata": {},
   "source": [
    "## True or False\n",
    "\n",
    "**1.** C# is a compiled, statically-typed language.\n",
    "\n",
    "```{dropdown} Answer\n",
    "**True** — C# code is compiled to IL then JIT-compiled at runtime.\n",
    "```\n",
    "\n",
    "**2.** The `dotnet run` command compiles and executes a C# project in one step.\n",
    "\n",
    "```{dropdown} Answer\n",
    "**True** — `dotnet run` calls the compiler then runs the output automatically.\n",
    "```\n",
    "\n",
    "**3.** A `namespace` in C# is used to execute code at program startup.\n",
    "\n",
    "```{dropdown} Answer\n",
    "**False** — A `namespace` organizes related classes; code runs from `Main`.\n",
    "```\n",
    "\n",
    "**4.** In C#, code blocks are delimited by indentation (like Python).\n",
    "\n",
    "```{dropdown} Answer\n",
    "**False** — C# uses curly braces `{}` to delimit code blocks.\n",
    "```\n",
    "\n",
    "**5.** Visual Studio Code requires a C# extension to provide IntelliSense support.\n",
    "\n",
    "```{dropdown} Answer\n",
    "**True** — The C# Dev Kit extension adds language support including IntelliSense.\n",
    "```\n",
    "\n",
    "**6.** A single `.csproj` project can contain multiple `.cs` files but only one entry point (`Main()` method).\n",
    "\n",
    "```{dropdown} Answer\n",
    "**True** — A project can have many `.cs` files (each defining classes or helpers), but only one file may serve as the entry point with a `Main()` method or top-level statements.\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2b674742-efd4-4220-a57e-f36b36aa92e1",
   "metadata": {},
   "source": [
    "## Multiple Choice\n",
    "\n",
    "**1.** What is the entry point method of a C# console application?\n",
    "\n",
    "a) Start()  \n",
    "b) Init()  \n",
    "c) Main()  \n",
    "d) Run()\n",
    "\n",
    "```{dropdown} Answer\n",
    "**c) Main()** — `Main()` is where the CLR begins execution.\n",
    "```\n",
    "\n",
    "**2.** Which command creates a new C# console project?\n",
    "\n",
    "a) dotnet init  \n",
    "b) dotnet new console  \n",
    "c) dotnet create  \n",
    "d) dotnet build\n",
    "\n",
    "```{dropdown} Answer\n",
    "**b) dotnet new console** — `dotnet new console` scaffolds a new console application.\n",
    "```\n",
    "\n",
    "**3.** In C#, which keyword groups related classes under a common name?\n",
    "\n",
    "a) package  \n",
    "b) module  \n",
    "c) namespace  \n",
    "d) library\n",
    "\n",
    "```{dropdown} Answer\n",
    "**c) namespace** — `namespace` is the C# equivalent of Java packages or Python modules.\n",
    "```\n",
    "\n",
    "**4.** Which statement outputs text to the console?\n",
    "\n",
    "a) print(\"Hello\")  \n",
    "b) Console.Print(\"Hello\")  \n",
    "c) Console.WriteLine(\"Hello\")  \n",
    "d) Output(\"Hello\")\n",
    "\n",
    "```{dropdown} Answer\n",
    "**c) Console.WriteLine(\"Hello\")** — `Console.WriteLine()` writes a line to standard output.\n",
    "```\n",
    "\n",
    "**5.** What file extension is used for C# source files?\n",
    "\n",
    "a) .net  \n",
    "b) .csharp  \n",
    "c) .cs  \n",
    "d) .cpp\n",
    "\n",
    "```{dropdown} Answer\n",
    "**c) .cs** — C# source files use the `.cs` extension.\n",
    "```\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "074a670b-0a9a-4838-8785-bae6b9566d3b",
   "metadata": {},
   "source": [
    "```{rubric} Footnotes\n",
    "```\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".NET (C#)",
   "language": "C#",
   "name": ".net-csharp"
  },
  "language_info": {
   "name": "polyglot-notebook"
  },
  "polyglot_notebook": {
   "kernelInfo": {
    "defaultKernelName": "csharp",
    "items": [
     {
      "aliases": [],
      "name": "csharp"
     }
    ]
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
