{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true)\n", "\n", "\"Open" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# CALM - Moving Out 5\n", "## Part 5 - Transportation\n", "\n", "๐Ÿ“•We will just be comparing the cost of purchasing and operating a vehicle to the cost of a monthly bus pass.\n", "\n", "### Owning and Operating a Car\n", "\n", "Complete this section regardless of whether you already have a car or decide against owning a car.\n", "\n", "Find an advertisement for a vehicle (new or used) that you would like to drive. If you already a vehicle consider the next vehicle you would purchase if you were to upgrade or replace your car in the event of huge repair bill or accident.\n", "\n", "To find out how much car insurance will cost, use one of these online [insurance](https://www.lowestrates.ca/insurance/auto/alberta) [quote](https://www.insurancehotline.com/Quote/Auto?postalCode=T8A4Y1#Vehicles) [sites](https://www.pcinsurance.ca/en/).\n", "\n", "As well, look up and record the cost of [registering a vehicle](https://www.alberta.ca/vehicle-registration-renewal.aspx), and list the approximate current price of fuel.\n", "\n", "Complete the statements then `Run` the cell." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%writefile moving_out_6.txt\n", "โœ๏ธ\n", "Link to vehicle advertisement:\n", "\n", "I chose this vehicle because: \n", "\n", "The total price of this vehicle is: \n", "\n", "Year: \n", "\n", "Make: \n", "\n", "Model: \n", "\n", "Car insurance will cost about $ per month.\n", "\n", "To register a car in Alberta costs $\n", "\n", "Fuel is currently $ per litre." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Car Loan\n", "\n", "๐Ÿ“•Now let's consider the cost of a loan to purchase that vehicle. Enter the purchase price and `Run` the code cell to calculate monthly costs." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#โœ๏ธ\n", "purchasePrice = 5000\n", "\n", "interestRate = 0.07 # assume a 7% interest rate\n", "financingTerm = 48 # 48 months is four years\n", "\n", "monthlyInterest = interestRate / 12\n", "monthlyCarPayment = purchasePrice * (monthlyInterest) * ((1+monthlyInterest) ** financingTerm) / (((1+monthlyInterest) ** financingTerm)-1)\n", "totalCarCost = monthlyCarPayment * financingTerm\n", "print('Purchasing this vehicle with financing will cost $' + str('{:.2f}'.format(monthlyCarPayment)) + ' per month.')\n", "print('The total cost of the vehicle over', financingTerm, 'months will be $' + str('{:.2f}'.format(totalCarCost)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Other Vehicle Expenses\n", "\n", "๐Ÿ“•Operating a vehicle is expensive and we often donโ€™t realize the costs of repairs, oil changes, tires, gas, registration, or depreciation. Keep in mind there are additional costs for driving offenses such as speeding, running a red light, distracted driving, and parking tickets.\n", "\n", "According to the Canadian Automobile Association the average Canadian drives 20,000 km per year for work, recreation and travel. \n", "\n", "Go to the Canadian Automobile Associate (CAA) [Driving Cost Calculator](http://caa.ca/car_costs) to \n", "estimate the operating cost for the year, make, and model of your selected vehicle.\n", "\n", "Fill in your numbers and `Run` the code cell below. If you get an error, check that you have run the cell above this one." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#โœ๏ธ\n", "vehicleInsurance = 0\n", "otherVehicleExpenses = 0\n", "\n", "vehicleCosts = monthlyCarPayment + vehicleInsurance + otherVehicleExpenses\n", "%store vehicleCosts\n", "print('Estimated vehicle costs per month are $' + str('{:.2f}'.format(vehicleCosts)) + '.')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "๐Ÿ“•Type your responses in the code cell below, and `Run` the cell once you have finished." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%writefile moving_out_7.txt\n", "โœ๏ธ\n", "\n", "My estimated vehicle costs per month are $\n", "\n", "An adult monthly bus pass costs: $ in (Sherwood Park / Edmonton / myCity).\n", "or\n", "I will be attending post-secondary, so U-Pass costs: $ per semester.\n", "\n", "\n", "I have decided that for transportation I will \n", "because" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "๐Ÿ“•In the code cell below, enter the cost of a monthly bus pass (e.g. `busPass = 98`) and your decision about transportation:\n", "\n", "`transportationDecision = 1` if you plan to take the bus\n", "\n", "`transportationDecision = 2` if you plan to drive a vehicle\n", "\n", "Then `Run` the cell to calculate and store your responses." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#โœ๏ธ Enter the cost of a monthly bus pass\n", "busPass = 0\n", "\n", "#โœ๏ธ Change this to 1 for taking the bus or 2 for driving a vehicle\n", "transportationDecision = 0\n", "\n", "#๐Ÿ“• Run this cell when you've answered the questions above in order to calculate monthly transportation costs.\n", "transportationCost = 0\n", "if transportationDecision == 1:\n", " transportationCost = busPass\n", " print('You will be spending $' + str(transportationExpenses) + ' per month to take the bus.')\n", "elif transportationDecision == 2:\n", " transportationCost = vehicleCosts\n", " print('You will be spending approximately $' + str('{:.2f}'.format(vehicleCosts)) + ' for your vehicle.')\n", "else:\n", " print('Please change transportationDecision to 1 or 2 and run the cell again.')\n", "%store transportationCost" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "๐Ÿ“•`Run` the next cell to check that your answers have been stored." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#๐Ÿ“• Run this cell to check that your answers have been stored\n", "print('Transportation cost:', transportationCost)\n", "with open('moving_out_6.txt', 'r') as file6:\n", " print(file6.read())\n", "with open('moving_out_7.txt', 'r') as file7:\n", " print(file7.read())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "๐Ÿ“•You have now completed this section. Proceed to [section 6](./CALM-moving-out-6.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[![Callysto.ca License](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-bottom.jpg?raw=true)](https://github.com/callysto/curriculum-notebooks/blob/master/LICENSE.md)" ] } ], "metadata": { "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.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }