Now You Code 1: Check Splitter

Write a Python program which splits up a restaurant check. It first prompts you to input the total amount of your check, then the number of people dining. It should then output the amout each diner must contribute to the check. For example:

*** Check Splitter ***
How much is the amount of the check? 100.00
How many people ? 6
Each person owes: $16.67

NOTE: Use string formatters to display the output to two decimal places.

Step 1: Problem Analysis

Inputs:

Outputs:

Algorithm (Steps in Program):


In [1]:
# Step 2: Write code here

Step 3: Questions

  1. What happens when you enter TWO instead of 2 for the number of people dining? or $60 as the amount of the check, instead of 60?

Answer:

  1. What type of error is this? Do you think it can be handled in code?

Answer:

  1. Explain what happens when you enter 0.5 for the number of people dining? Does the program run? Does it make sense?

Answer:

Step 4: Reflection

Reflect upon your experience completing this assignment. This should be a personal narrative, in your own voice, and cite specifics relevant to the activity as to help the grader understand how you arrived at the code you submitted. Things to consider touching upon: Elaborate on the process itself. Did your original problem analysis work as designed? How many iterations did you go through before you arrived at the solution? Where did you struggle along the way and how did you overcome it? What did you learn from completing the assignment? What do you need to work on to get better? What was most valuable and least valuable about this exercise? Do you have any suggestions for improvements?

To make a good reflection, you should journal your thoughts, questions and comments while you complete the exercise.

Keep your response to between 100 and 250 words.

--== Write Your Reflection Below Here ==--