Prompt the user to input a food item name

Assignment Help Basic Computer Science
Reference no: EM132007625

This is for CS 200 not sure what i keep doing wrong python 3 coding:

2.13 Program: Food receipt (Python 3)

Note: When accuracy is essential, floats are not used to represent currency due to rounding and accumulation errors. Python provides several primitives specifically developed to implement financial applications. However, these topics are beyond the scope of this lab.

(1) Prompt the user to input a food item name, price, and quantity. Output an itemized receipt.

Enter food item name: hot dog
Enter item price: 2
Enter item quantity: 5

RECEIPT
5 hot dog @ $ 2.0 = $ 10.0
Total cost: $ 10.0

(2) Extend the program to prompt the user for a second item. Output an itemized receipt.

Enter food item name: hot dog
Enter item price: 2
Enter item quantity: 5

RECEIPT
5 hot dog @ $ 2.0 = $ 10.0
Total cost: $ 10.0


Enter second food item name: ice cream
Enter item price: 2.50
Enter item quantity: 4

RECEIPT
5 hot dog @ $ 2.0 = $ 10.0
4 ice cream @ $ 2.5 = $ 10.0
Total cost: $ 20.0

(3) Extend again to output a third receipt that adds a mandatory 15% gratuity to the total cost. Output the total cost, the cost of gratuity, and the grand total.

Enter food item name: hot dog
Enter item price: 2
Enter item quantity: 5

RECEIPT
5 hot dog @ $ 2.0 = $ 10.0
Total cost: $ 10.0


Enter second food item name: ice cream
Enter item price: 2.50
Enter item quantity: 4

RECEIPT
5 hot dog @ $ 2.0 = $ 10.0
4 ice cream @ $ 2.5 = $ 10.0
Total cost: $ 20.0

15% gratuity: $ 3.0
Total with tip: $ 23.0

This is what I did and my code is wrong on the very last part specifically line 20 please help

# FIXME (3): Add a gratuity and total with tip to the second receipt

(line 20 where it says im wrong)

tip: =0.15 * (item_Qty * item_Price + item_Qty2 * item_Price2))

Reference no: EM132007625

Questions Cloud

Purpose of sql server management studio designers : What is the purpose of the SQL Server Management Studio Designers? Does this tool create only a physical model, or does it create the actual database?
The nominal annual rate of interest : Reese contributed $1,500.00 every six months into an RRSP for 20 years. The nominal annual rate of interest is___% compounded semi annually.
Ransomware attacks come from an email or website : Is Ransomware attacks conducted by emails and does more Ransomware attacks come from an email or website
Evaluate process metrics using statistical process control : Evaluate the process metrics using Statistical Process Control (SPC) methods, specifically use of Excel to calculate the statistics Mean, Median, Mode, Range.
Prompt the user to input a food item name : When accuracy is essential, floats are not used to represent currency due to rounding and accumulation errors. Python provides several primitives
Consequences of downgrade of country rating : What are the consequences of a downgrade of a country rating by an individual rating agency for other economic agents?
Explain the different types of financial statements : Think about the different types of financial statements you learned about in this unit (the income statement, statement of retained earnings, balance sheets.
Explain why a reference to the fragmentmanager : Explain why a reference to the FragmentManager is passed to ItemCursorAdapter's constructor?
All of net working capital will be recouped : All of the net working capital will be recouped at the end of the project. What is the project's NPV if the tax rate is 33%?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Purchase the bond at the current market price

What is the value of the bonds to you given the yield to maturity on a comparable-risk bond? Should you purchase the bond at the current market price?

  Security models and cloud operations

From the first e-Activity, analyze the industry researched for each security model would be most applicable, and explain why you believe that to be the case. Identify the security models from your findings.

  Specifications for a data backup facility for a company

If a firm is contracted to provide the specifications for a data backup facility for a company that was just devastated by an F3 tornado.

  In what ways does it planning help managers exercise

In what ways does IT planning help managers exercise control in a situation? Does IT impact the truck driver of a company who delivers supplies to its customer?

  Describe the weakness of these two values

Why are the values 1 and p - 1 excluded? Describe the weakness of these two values.

  Give an algorithm for computing the diameter of a graph

The diameter of an unweighted graph is the maximum of all the shortest distances between pairs of vertices in the graph.

  What does your confidence interval suggest

The company must decide whether to now do a mass mailing. The mailing won't be cost-effective unless it produces at least a 5% return. What does your confidence interval suggest? Explain.

  What is privacy in an information security context

What is another name for the Kennedy-Kassebaum Act (1996), and why is it important to organizations that are not in the health care industry?

  What is the long-run phillips curve

What is the long-run Phillips curve and why is Say's law important?

  Determining asymptotic formula for recurrence equations

Give an asymptotic formula for each of the recurrence equations given below, using big "Θ" rather than just big "O" for better results when possible.

  Calculate the heat transfer per unit mass of water

A 110-volt electrical heater is used to warm 0.3 m3 /s of air at 100 kPa and 15°C to 100 kPa and 30°C. How much current in amperes must be supplied to this heater?

  Enter three integers from the keyboard

Enter three integers from the keyboard Calculate and display the sum of the numbers Select and display the smallest of the numbers

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd