0% found this document useful (0 votes)
233 views3 pages

You Are Tasked With Creating A Python Program To Help Plan A Birthday Celebration

The document outlines a programming task to create a Python program for planning a birthday celebration by calculating estimated costs across five expense categories. It includes a function for validating user input and computes the total cost against a predefined budget of $1000. The program provides a summary of the total estimated cost and whether it is within budget.

Uploaded by

Danloyd Urdanetz
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)
233 views3 pages

You Are Tasked With Creating A Python Program To Help Plan A Birthday Celebration

The document outlines a programming task to create a Python program for planning a birthday celebration by calculating estimated costs across five expense categories. It includes a function for validating user input and computes the total cost against a predefined budget of $1000. The program provides a summary of the total estimated cost and whether it is within budget.

Uploaded by

Danloyd Urdanetz
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
You are on page 1/ 3

Urdaneta, Dan Lloyd B.

BSCS 601
Programming Language

Performance Task

You are tasked with creating a Python program to help plan a birthday celebration. The program will
prompt users to input estimated costs for five (5) different expense categories: venue, catering,
decorations, entertainment, and miscellaneous items. The program will then calculate the total
estimated cost and determine if it falls within a predefined budget.
CODE:

# Birthday Celebration Budget Calculator

# Function to get valid numerical input

def get_cost(category):

while True:

try:

cost = float(input("Enter the estimated cost for {}:


$".format(category)))

if cost < 0:

print("Please enter a positive number.")

continue

return cost

except ValueError:

print("Invalid input. Please enter a numerical value.")

# Input estimated costs

venue_cost = get_cost("Venue")

catering_cost = get_cost("Catering")

decorations_cost = get_cost("Decorations")

entertainment_cost = get_cost("Entertainment")

misc_cost = get_cost("Miscellaneous")

# Calculate total estimated cost

total_cost = 0
total_cost += venue_cost

total_cost += catering_cost

total_cost += decorations_cost

total_cost += entertainment_cost

total_cost += misc_cost

# Define a predefined budget

budget = 1000.00 # You can change this value

# Output the total and budget comparison

print("\n--- Birthday Budget Summary ---")

print("Total Estimated Cost: ${:.2f}".format(total_cost))

print("Budget: ${:.2f}".format(budget))

if total_cost <= budget:

print("Status: The total estimated cost is within the budget.")

else:

print("Status: The total estimated cost exceeds the budget.")

You might also like