Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

num_items = int(input(How many different items are being purchased? )) def calculate_subtotal(part_number, description, price, quantity): subtotal = price * quantity print(fItem: {description}, Part Number {part_number},

num_items = int(input("How many different items are being purchased? "))

def calculate_subtotal(part_number, description, price, quantity): subtotal = price * quantity print(f"Item: {description}, Part Number {part_number}, subtotal: ${subtotal:.2f} ") return subtotal

def user_input(item_quantity): subtotal = 0.0 for i in range(item_quantity): description = input(' 'f"Enter description of item {i+1} " ) part_number = input(f"Enter part number of item {i+1} ") price = float(input(f"Enter the price of item {i+1} ")) quantity = int(input(f"Enter the quantity for item {i+1} "))

subtotal += calculate_subtotal(part_number, description,price, quantity) return subtotal

if __name__ == '__main__': total = 0.0 total = user_input(num_items)

print(' 'f"Your total is ${total:.2f}")

I need each line of pseudocode in python for this function as much detail that you can provide. "How was each line of this this function made "???

Thanks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago