Touchstone 4 Python Journal Project Assignment ✓ Solved

Touchstone 4 Python Journal Project assignment for This Project You W

Develop a detailed journal documenting the process of planning, designing, developing, and testing an original Python program of your choosing. Your journal should include all five sections outlined in the provided template:

  • Part 1: Define the problem including inputs and outputs.
  • Part 2: Write clear, logical steps to solve a simple version of the problem.
  • Part 3: Create pseudocode that represents the full functionality of your program.
  • Part 4: Describe your testing process, errors encountered, and how you fixed them.
  • Part 5: Submit your full program code with comments explaining the flow for clarity.

Ensure your journal is well-written with appropriate academic formatting, proper grammar, and no plagiarism. Submit all parts in a single .doc or .docx file, including your Replit link to the completed program. Your program should function correctly, with all inputs and outputs as intended.

Sample Paper For Above instruction

Title: Developing a Python Program for Automated Budget Tracking

Introduction

Planning and designing an effective Python program requires a systematic approach to problem-solving. In this journal, I will document my process of creating an automated budget tracking application, which aims to help users monitor their income and expenses seamlessly. Developing this program involves defining the problem, devising simple solutions, translating these solutions into pseudocode, conducting thorough testing, and commenting on the code to ensure clarity and maintainability.

Part 1: Defining the Problem

The primary goal of this project is to develop a Python application that allows users to input their income and expenses, categorize their spending, and view summaries of their financial status. The inputs include the user's income, expenses, categories, and transaction details, while outputs consist of total income, total expenses, category-wise expense breakdowns, and remaining balance. The program must be user-friendly and capable of storing data persistently, possibly through file handling, to enable ongoing tracking over time.

Part 2: Working Through Specific Examples

To illustrate, consider a user who wants to record a $200 grocery expense. The steps involve first prompting the user for the expense amount, category, and date. After input, the program should validate the data, add the expense to a list or database, and update total expenses. When the user requests a summary, the program sums all expenses, groups them by category, and calculates remaining balance based on total income. The logical sequence involves input validation, data storage, calculation, and reporting functions.

Part 3: Generalizing Into Pseudocode

START

DEFINE income, expenses_list, categories

PROMPT user for total income

INITIALIZE expenses_list as empty

WHILE user wants to add expenses

PROMPT for expense amount

PROMPT for category

PROMPT for date

VALIDATE inputs

ADD expense to expenses_list with details

END WHILE

CALCULATE total expenses

GROUP expenses by category

COMPUTE remaining balance as income minus total expenses

DISPLAY summary report: total income, total expenses, category breakdown, remaining balance

END

Part 4: Testing Your Program

I tested the program by entering sample income and multiple expenses across different categories. Initially, I encountered errors related to data validation, such as entering non-numeric values for amounts. To resolve this, I implemented try-except blocks to catch input errors and prompt re-entry. Additionally, I tested the grouping functions by adding expenses with various categories and verified that the summaries matched the input data. These tests ensured the program operates correctly under multiple scenarios.

Part 5: Commenting Your Program

Start of the program

Input total income from the user

income = float(input("Enter your total income: "))

expenses = [] # List to store expenses

Loop to add multiple expenses

while True:

try:

amount = float(input("Enter expense amount: "))

category = input("Enter expense category: ")

date = input("Enter date (YYYY-MM-DD): ")

Store the expense as a dictionary

expense = {'amount': amount, 'category': category, 'date': date}

expenses.append(expense)

except ValueError:

print("Invalid input for amount. Please enter a numeric value.")

continue

more = input("Add another expense? (yes/no): ").lower()

if more != 'yes':

break

Calculate total expenses

total_expenses = sum(expense['amount'] for expense in expenses)

Group expenses by category

category_totals = {}

for expense in expenses:

cat = expense['category']

category_totals[cat] = category_totals.get(cat, 0) + expense['amount']

Calculate remaining balance

remaining = income - total_expenses

Display the summaries

print(f"Total Income: ${income}")

print(f"Total Expenses: ${total_expenses}")

print("Expenses by category:")

for cat, total in category_totals.items():

print(f" - {cat}: ${total}")

print(f"Remaining Balance: ${remaining}")

End of program

Part 6: Your Completed Program

The program successfully records income and expenses, provides detailed summaries, and handles input errors gracefully. It is designed with clear comments for readability and easy maintenance.

References

  • Downey, A. (2015). Think Python: How to Think Like a Computer Scientist. Green Tea Press.
  • Lutz, M. (2013). Learning Python. O'Reilly Media.
  • McKinney, W. (2018). Python for Data Analysis. O'Reilly Media.
  • Van Rossum, G., & Drake, F. L. (2009). Python 3 Reference Manual. CreateSpace.
  • Beazley, D. (2014). Python Essential Reference. Addison-Wesley.
  • Knuth, D. E. (1997). The Art of Computer Programming, Volume 1: Fundamental Algorithms. Addison-Wesley.
  • NumPy Developers. (2020). NumPy User Guide. https://numpy.org/doc/stable/
  • Pandas Development Team. (2023). pandas documentation. https://pandas.pydata.org/docs/
  • Reinert, C. (2019). Practical Programming: A Guide for Beginners. Wiley.
  • Python Software Foundation. (2023). Python Language Reference. https://docs.python.org/3/reference/