{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "0779a035",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Comments\n",
    "#### CS 65: Introduction to Computer Science I"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a042eeb7",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Programming for humans\n",
    "\n",
    "__Comments:__ elements of a program which are ignored by the interpreter\n",
    "* help document how to use the code properly\n",
    "* explain what's going on with more complex code\n",
    "* cite references\n",
    "* temporarily ignore some code\n",
    "* anything for the sake of humans (you and others)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "429a91da",
   "metadata": {
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "source": [
    "`#` starts a comment - everything on the rest of the line is ignored"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "07ca2756",
   "metadata": {},
   "outputs": [],
   "source": [
    "avg_gas_estimate = 2.70  #current price per gallon in Des Moines\n",
    "round_trip_miles_to_memphis = 1224\n",
    "vehicle_mpg = 32\n",
    "gas_cost = avg_gas_estimate * (round_trip_miles_to_memphis/vehicle_mpg)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5e85ef68",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Multiline comments\n",
    "\n",
    "Text surrounded by three sets of quotes will all be ignored - spanning multiple lines"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "12cfc086",
   "metadata": {},
   "outputs": [],
   "source": [
    "\"\"\"\n",
    "Here are some estimates used to help calculate\n",
    "the budget for our vacation to Memphis next\n",
    "spring break.\n",
    "\"\"\"\n",
    "avg_gas_estimate = 2.70 #current price in Des Moines\n",
    "round_trip_miles_to_memphis = 1224\n",
    "vehicle_mpg = 32\n",
    "gas_cost = avg_gas_estimate * (round_trip_miles_to_memphis/vehicle_mpg)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f861f822",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Common uses"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ceb00017",
   "metadata": {},
   "outputs": [],
   "source": [
    "avg_gas_estimate = 2.70 #current price in Des Moines\n",
    "round_trip_miles_to_memphis = 1224\n",
    "vehicle_mpg = 32\n",
    "gas_cost = avg_gas_estimate * (round_trip_miles_to_memphis/vehicle_mpg)\n",
    "\n",
    "vacation_days = 8\n",
    "\n",
    "#camping_nights = 3\n",
    "#hotel_nights = vacation_days-1-camping_nights\n",
    "hotel_nights = vacation_days-1\n",
    "hotel_per_night_cost = 96 #Airbnb near Graceland\n",
    "lodging_cost = hotel_nights * hotel_per_night_cost\n",
    "\n",
    "food_per_person_per_day = 40\n",
    "num_people = 4\n",
    "total_food_per_day = food_per_person_per_day*num_people\n",
    "souvenirs_and_incidentals_per_day = 100\n",
    "food_and_incidental_cost = vacation_days*(total_food_per_day+souvenirs_and_incidentals_per_day)\n",
    "\n",
    "#TODO: look up cost for a Grizzlies game and see if we can afford it\n",
    "\n",
    "#https://www.graceland.com/ticket-information\n",
    "graceland_ticket_cost = 190\n",
    "graceland_cost = num_people * graceland_ticket_cost,\n",
    "\n",
    "vacation_budget = gas_cost + lodging_cost + food_and_incidental_cost + graceland_cost\n",
    "print(\"Vacation budget:\",vacation_budget)"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Slideshow",
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
