0% found this document useful (0 votes)
15 views9 pages

Python Tip Calculator Journal Template

Richard Torres Romero is creating a Tip Calculator program to help restaurant customers calculate the tip based on the total bill and preferred tip percentage. The program will take user inputs for the bill amount and tip percentage, calculate the tip and total amount, and display the results. Testing has been conducted to ensure the program handles various inputs correctly, including edge cases.

Uploaded by

rtorwaz24
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views9 pages

Python Tip Calculator Journal Template

Richard Torres Romero is creating a Tip Calculator program to help restaurant customers calculate the tip based on the total bill and preferred tip percentage. The program will take user inputs for the bill amount and tip percentage, calculate the tip and total amount, and display the results. Testing has been conducted to ensure the program handles various inputs correctly, including edge cases.

Uploaded by

rtorwaz24
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Python Journal Template

Directions: Follow the directions for each part of the journal template. Include in your response
all the elements listed under the Requirements section. Prompts in the Inspiration section are
not required; however, they may help you to fully think through your response.
Remember to review the Touchstone page for entry requirements, examples, and grading
specifics.

Name: Richard Torres Romero


Date: June 3rd, 2025
Final IDE Program Share Link:
Complete the following template. Fill out all entries using complete sentences.

Python Journal Template 1


PART 1: Defining Your Problem

Task
State the problem you are planning to solve.

Requirements
● Describe the problem you are trying to solve for.
● Describe any input data you expect to use.
● Describe what the program will do to solve the problem.
● Describe any outputs or results the program will provide.

Inspiration
When writing your entry below ask yourself the following questions:
● Why do you want to solve this particular problem?

● What source(s) of data do you believe you will need? Will the user need to supply that data,
or will you get it from an external file or another source?
● Will you need to interact with the user throughout the program? Will users continually need to
enter data in and see something to continue?
● What are your expected results or what will be the end product? What will you need to tell a
user of your program when it is complete?

Task:
I am planning to create a Tip Calculator program. This program will help restaurant customers
quickly calculate how much tip to leave based on the total bill amount and their preferred tip
percentage.

Requirements:
The problem is that many people have difficulty quickly calculating the tip amount when paying a
bill. The input data expected will be the total bill amount (a number) and the desired tip percentage
(also a number).
The program will solve the problem by asking the user to input these two numbers, calculating the tip
amount and the total amount (bill + tip), and then displaying the results clearly.
The output will be the calculated tip amount and the total bill amount including tip.

Python Journal Template 2


Inspiration:
I chose this problem because tipping is a common task, and automating it can save time and avoid
errors. The user will supply the data during program execution.
I expect the user to interact with the program by entering the bill and tip percentage. The final output
will tell the user how much they should leave as a tip and the total amount to pay.

PART 2: Working Through Specific Examples

Task
Write down clear and specific steps to solve a simple version of your problem you identified in Part 1.

Requirements
Complete the three steps below for at least two distinct examples/scenarios.
● State any necessary input data for your simplified problem.
● Write clear and specific steps in English (not Python) detailing what the program will do to
solve the problem.
● Describe the specific result of your example/scenario.

Inspiration
When writing your entry below ask yourself the following questions:
● Are there any steps that you don’t fully understand? These are places to spend more time
working out the details. Consider adding additional smaller steps in these spots.
● Remember that a computer program is very literal. Are there any steps that are unclear? Try
giving the steps of your example/scenario to a friend or family member to read through and
ask you questions about parts they don’t understand. Rewrite these parts as clearly as you
can.
● Are there interesting edge cases for your program? Try to start one of your
examples/scenarios with input that matches this edge case. How does it change how your
program might work?

Python Journal Template 3


Example 1:

● Input: Bill amount = 50.00, Tip percentage = 15

● Steps:

1. User enters 50 for bill amount.

2. User enters 15 for tip percentage.

3. Program calculates tip = 50 * 0.15 = 7.50.

4. Program calculates total = 50 + 7.50 = 57.50.

5. Program outputs tip amount: $7.50 and total amount: $57.50.

● Result: User knows to leave $7.50 tip and pay $57.50 total.

Example 2:

● Input: Bill amount = 120.00, Tip percentage = 20

● Steps:

1. User enters 120 for bill amount.

2. User enters 20 for tip percentage.

3. Program calculates tip = 120 * 0.20 = 24.00.

4. Program calculates total = 120 + 24.00 = 144.00.

5. Program outputs tip amount: $24.00 and total amount: $144.00.

● Result: User knows to leave $24.00 tip and pay $144.00 total.

PART 3: Generalizing Into Pseudocode

Task
Write out the general sequence your program will use, including all specific examples/scenarios you
provided in Part 2.

Python Journal Template 4


Requirements
● Write pseudocode for the program in English but refer to Python program elements where
they are appropriate. The pseudocode should represent the full functionality of the program,
not just a simplified version. Pseudocode is broken down enough that the details of the
program are no longer in any paragraph form. One statement per line is ideal.

Help with writing pseudocode


● Here are a few links that can help you write pseudocode with examples. Remember to check
out part 3 of the Example Journal Template Submission if you have not already. Note:
everyone will write pseudocode differently. There is no right or wrong way to write it other
than to make sure you write it clearly and in as much detail as you can so that it should be
easy to convert it to code later.
○ [Link]
○ [Link]

Inspiration
When writing your entry below ask yourself the following questions:
● Do you see common program elements and patterns in your specific examples/scenarios in
Part 2, like variables, conditionals, functions, loops, and classes? These should be part of
your pseudocode for the general sequence as well.
● Are there places where the steps for your examples/scenarios in Part 2 diverged? These may
be places where errors may occur later in the project. Make note of them.
● When you are finished with your pseudocode, does it make sense, even to a person that does
not know Python? Aim for the clearest description of the steps, as this will make it easier to
convert into program code later.

Start program
Display welcome message to user

Prompt user to enter bill amount


Read bill amount input and convert to float

Prompt user to enter tip percentage


Read tip percentage input and convert to float

Calculate tip amount = bill amount * (tip percentage / 100)


Calculate total amount = bill amount + tip amount

Display tip amount formatted as currency


Display total amount formatted as currency

End program

Python Journal Template 5


PART 4: Testing Your Program

Task
While writing and testing your program code, describe your tests, record any errors, and state your
approach to fixing the errors.

Requirements
● For at least one of your test cases, describe how your choices for the test helped you
understand whether the program was running correctly or not.
For each error that occurs while writing and testing your code:
● Record the details of the error from your IDE. A screenshot or copy-and-paste of the text into
the journal entry is acceptable.
● Describe what you attempted in order to fix the error. Clearly identify what approach was the
one that worked.

Inspiration
When writing your entry below ask yourself the following questions:
● Have you tested edge cases and special cases for the inputs of your program code? Often
these unexpected values can cause errors in the operation of your program.
● Have you tested opportunities for user error? If a user is asked to provide an input, what
happens when they give the wrong type of input, like a letter instead of a number, or vice
versa?
● Did the outcome look the way you expected? Was it formatted correctly?

● Does your output align with the solution to the problem you coded for?

Python Journal Template 6


Test case:
Input: Bill amount = 100, Tip percentage = 18

● Expected tip: $18.00

● Expected total: $118.00

Errors:

● Initially, I forgot to convert input strings to float, causing a TypeError during multiplication.

● Error message: TypeError: can't multiply sequence by non-int of type


'float'.

Fix:

● Added float() conversion when reading inputs. This solved the problem.

Further testing:

● Tested with zero tip percentage to verify it calculates zero tip correctly.

● Tested with decimal bill amounts (e.g., 55.75) and decimal tip percentages (e.g., 12.5). Both
worked as expected.

PART 5: Commenting Your Program

Task
Submit your full program code, including thorough comments describing what each portion of the
program should do when working correctly.

Requirements
● The purpose of the program and each of its parts should be clear to a reader that does not
know the Python programming language.

Inspiration
When writing your entry, you are encouraged to consider the following:
● Is each section or sub-section of your code commented to describe what the code is doing?

Python Journal Template 7


● Give your code with comments to a friend or family member to review. Add additional
comments to spots that confuse them to make it clearer.

# Tip Calculator Program


# This program calculates the tip and total amount to pay based on the bill and tip percentage

print("Welcome to the Tip Calculator!")

# Prompt the user to enter the total bill amount


bill_amount = float(input("Enter the bill amount: "))

# Prompt the user to enter the desired tip percentage


tip_percentage = float(input("Enter the tip percentage you want to leave: "))

# Calculate the tip amount by multiplying bill by tip percentage divided by 100
tip_amount = bill_amount * (tip_percentage / 100)

# Calculate the total amount to pay including tip


total_amount = bill_amount + tip_amount

# Display the calculated tip amount formatted to 2 decimal places


print(f"Tip amount: ${tip_amount:.2f}")

# Display the total bill amount including tip formatted to 2 decimal places
print(f"Total amount to pay: ${total_amount:.2f}")

PART 6: Your Completed Program

Task
Provide the IDE share link to your full program code.

Requirements
● The program must work correctly with all the comments included in the program.

Inspiration
● Check before submitting your touchstone that your final version of the program is running

Python Journal Template 8


successfully.

Final IDE Program Share Link:


[Link]

Python Journal Template 9

You might also like