Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in python: Calculates the total including sales tax (8.875%) of a shopping trip. Create a total variable and a tax variable. Total the items calculated

in python: Calculates the total including sales tax (8.875%) of a shopping trip. Create a total variable and a tax variable. Total the items calculated with tax. Be sure to test if the price is above zero. Continues to prompt the user to enter prices until they are done. Hint: enter a while loop until the user types done at the prompt. Hint: Since we don't know how many times the loop will execute, it makes the most sense to use a 'while' loop. You will need to prompt the user in 2 different places. Once outside of the loop and again as the last line inside the while loop. Pseudo code: Create a few variables to hold the price of the item and the total. Prompt the user to enter the price of the item. Enter loop, while the item is not equal to "done". Set a new variable to the price as a float value. Check if the price is 0 or higher, if less than 0 prompt the user to correct the price. (Hint: use a nested 'while' loop. Add the price to the total variable. Prompt the user to enter the price of the next item. End loop. Add up the total and calculate the tax. Format and display the total amount to the user. End program.

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

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students also viewed these Databases questions

Question

What is the relationship between diversity, inclusion, and equity?

Answered: 1 week ago