Doc
Doc
print(f"Order #{order_num}")
print(f"Labor: ${labor_cost:.2f}")
print(f"Tax: ${tax:.2f}")
print(f"Cost: ${total_cost:.2f}\n")
return total_cost
# Main program
if __name__ == "__main__":
total_sales += order_total
Program 2 :
import math
def calculate_tax_and_delivery(total_cost):
print(f"{party_name}")
print(f"Tax: ${tax:.2f}")
print(f"Delivery: ${delivery_charge:.2f}")
print(f"Total: ${total_cost:.2f}\n")
return total_cost
# Step 5: Combine totals for all parties
def main():
weekend_total = 0.0
# Weekend total
print(f"Weekend Total: ${weekend_total:.2f}")
if __name__ == "__main__":
main()
Program 3
# Input values
paint_can_cost = float(input("Enter the cost of one paint can (in dollars): "))
cans_needed = ceil(paint_needed)
# Step 4: Calculate the paint cost, sales tax, and total cost
Program 4
# Calculate AGI
print(f"AGI: ${agi:,}")
exit()
if status == 2: # Married
deduction = 24_000
deduction = 12_000
status = 1
deduction = 12_000
taxable_income = 0
print(f"Deduction: ${deduction:,}")
federal_tax = 0
if status == 1: # Single
else:
federal_tax = round(federal_tax)
if tax_due > 0:
else:
Program 5
HOMEWORK_MAX = 800.0
QUIZZES_MAX = 400.0
MIDTERM_MAX = 150.0
FINAL_MAX = 200.0
exit()
float, input("Enter points for homework, quizzes, midterm, and final (space-separated):
").split()
print(f"Homework: {homework:2.1f}%")
print(f"Quizzes: {quizzes:2.1f}%")
print(f"Midterm: {midterm:2.1f}%")
print(f"Final Exam: {final_exam:2.1f}%")
print(f"Homework: {homework:2.1f}%")
print(f"Quizzes: {quizzes:2.1f}%")
print(f"Midterm: {midterm:2.1f}%")