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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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