×
Samples Blogs Make Payment About Us Reviews 4.9/5 Order Now

Create a Program to Create a Shocking System in Python Assignment Solution

July 15, 2024
Professor Daniel Mitchell
Professor Daniel
🇨🇦 Canada
Python
l Professor Daniel Mitchell is an esteemed faculty member with a Master's degree in Software Engineering from a prestigious university in Canada. He has successfully completed over 700 assignments focusing on Python file operations. Professor Mitchell's expertise lies in file system design, secure file handling practices, and integrating file operations with database systems. His insights into binary file processing and path management make him a valuable resource for students seeking comprehensive Python file handling solutions.
Key Topics
  • Instructions
  • Requirements and Specifications
Tip of the day
Use Python libraries effectively by importing only what you need. For example, if you're working with data, using libraries like pandas and numpy can save time and simplify complex tasks like data manipulation and analysis.
News
In 2024, the Biden-Harris Administration has expanded high-dosage tutoring and extended learning programs to boost academic achievement, helping programming students and others recover from pandemic-related setbacks. These initiatives are funded by federal resources aimed at improving math and literacy skills​

Instructions

Objective

Write a Python Assignment program to create a shocking system.

Requirements and Specifications

Corissa Cox

ENTD200 B002 Spr21

Sammy Abaza

Week # 5

5/8/2021

prompt user for shopper name

save user input to shopper name

prompt user for store

save user input to store

prompt user for date

save user input to date

prompt user for item purchased

save user input to item

prompt user for item quantity

save user input to qnt

prompt user for item cost

save user input to item cost

promote user for commute expense

save user input to commute

Product total= Item price*quantity

prompt user if they would like to add more items

if yes then

prompt user for item quantity

prompt user for item cost

Product total= product total + item price* quantity

continue loop

else

no

end loop

Total Expenses= product total + commute expenses

print thank you for shopping, have a great day! total expenses

Source Code

def main(): # Ask for inputs shopper_name = input("Enter shopper name: ") store_name = input("Enter store name: ") item_name = input("Enter item name: ") item_qty = int(input("Enter quantity: ")) item_cost = float(input("Enter cost: ")) item_commute = float(input("Enter commute expense: ")) # Define lists to store all items items = list() items.append((item_name, item_qty, item_cost, item_commute)) # Display total total_expense = item_cost * item_qty + item_commute print("Product Total: ${:.2f}".format(item_qty*item_cost + item_commute)) print("") # While loop to keep adding items while True: yesno = input("Do you want to add another item (y/n)? ").lower() if yesno == "y": item_name = input("Enter item name: ") item_qty = int(input("Enter quantity: ")) item_cost = float(input("Enter cost: ")) item_commute = float(input("Enter commute expense: ")) # append new item items.append((item_name, item_qty, item_cost, item_commute)) total_expense += item_cost * item_qty + item_commute print("Product Total: ${:.2f}".format(item_qty * item_cost + item_commute)) elif yesno == "n": # Print invoice print('=' * 55) print("Store: " + store_name) print('=' * 55) print("Client: " + shopper_name) print('=' * 55) print("{:<10s} {:>10s} {:>10s} {:>10s} {:>10s}".format("Name", "Quantity", "Cost", "Commute", "Total")) print('-'*55) for item in items: product_cost = item[1]*item[2] + item[3] print("{:<10s} {:>10d} {:>10.2f} {:>10.2f} {:>10.2f}".format(item[0], item[1], item[2], item[3], product_cost)) print('-' * 55) print("") rint('-' * 55) print("Total Expenses: ${0:.2f}".format(total_expense)) break else: print("Invalid option.") print("") print("Thank you for shopping, have a great day!") if __name__ == '__main__': main()

Similar Samples

Explore our Python assignment sample to understand how we tackle complex programming tasks with clarity and precision. Our samples demonstrate practical applications, from basic syntax to advanced algorithms, ensuring clarity and understanding for students seeking assistance. See firsthand how our expert solutions can elevate your programming skills and academic performance.