Question: Problem: Create flowchart and pseudo code to do the following:- Modify week 4 assignmentto use input() function (no hard coded values) to prompt the user

Problem:

Create flowchart and pseudo code to do the following:-

Modify week 4 assignmentto use input() function (no hard coded values) to prompt the user to enter the values.

Make sure the prompt message is meaningful, do not say "Enter value", say something like this "Enter item name " after you get all the inputs, display the results and prompt the user if wants more calculation(add more items) (y/n). If no then print a message like "Thank you for ......."

The flowchart must include a loop, if-then and the total expenses.

WEEK 4 ASSIGNMENT

"""

Paul Johnson

ENTD200 B003 Spring 2023

Professor Smith

Week# 4

4/24/2023

"""

# Taking input values from user

shopper_name = input("Enter shopper name: ")

shop_name = input("Enter supermarket name: ")

shop_date = input("Enter shopping date (MM/DD/YYYY): ")

item_name = input("Enter item name: ")

item_price = float(input("Enter item price: "))

item_quantity = int(input("Enter item quantity: "))

commute_type = input("Enter commute type: ")

commute_fee = float(input("Enter commute fee: "))

# Calculating subtotal and total

sub_total = item_price * item_quantity

total = sub_total + commute_fee

# Printing details in neat fromat using format() method

print(" Shopper name:", shopper_name)

print(shop_name)

print(shop_date)

print("{:<20}{:<10}{:<13}{}".format('Item','Price','Quantity','Total'))

print("{:<20}{:<12.2f}{:<11}{:.2f}".format(item_name,item_price,item_quantity,sub_total))

print("Commute expense")

print("Commute type: {:<25}Fee: {:.2f}".format(commute_type, commute_fee))

print("{:<43}{:>5.2f}".format('Total expenses',total))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!