Taking a Vacation

Lab 2

The task of this lab was to calculate a cost of a trip. The total cost included cost of staying in a hotel, renting a car, plane ride, and extra spending money. This also included discounts for renting a car a certain amount of days. Step one was to define the Hotel Nights and multiply that by 140$. This was an easy step, but the next step was a bit more challenging. Step 2 was to create and define the plane ride cost. This would change depending on the city. Therefore, instead of having one cost we had 4 different cost depending on the city. We did this by using “if” and “elif”. This step is shown on the second picture below. The third step had us define the rental car cost with the argument days. Depending on the amount of days there would be a discount. Because of this the return would be the cost of days minus 50 or 20 dollars. This is shown in picture 3. Step 4 had us defining the total trip cost by adding all three of the past aspects in steps one, two, and three. Step 5 had us modify step 4 in the lab. We modified it by adding spending money. Finally, we put our program to the test. We calculated the cost of a trip to Los Angeles in which we would stay for 5 days, and having 600$ of spending money. Ultimately, our trip cost resulted in 1955$.

planning a trip pg1

planning a trip pg2

planning a trip pg3

planning a trip pg4

planning a trip pg 5

planning a trip pg6