Sunday
April 20, 2014

Homework Help: python 3

Posted by Anita on Monday, October 29, 2012 at 11:07pm.

For this option, first ask the user how many items there will be. ("How many
items will there be?") Then, accept a name, a price, a name, a price, etc. until you have enough name-price pairs. You should then format the receipt so that each item shows up on a separate line, with the name left-aligned, spacing filled with periods, all the way to the prices, which should all show up in the format $X.XX (using more columns to the left if necessary).
• The entire width of the receipt must be exactly 30 characters wide. We won't test any inputs where
that's impossible, but you will have to figure out the spacing to make it happen.
• Accept floats as the prices. If the user types in 3.3456, then the price should post as $3.35 (exactly
how the format method behaves… hint hint).
• Include a "Total" line with the correct price, also aligned to the same 30 character width.
• Notice how in the example below, the price on one line and the name on another line might overlap.
• If any rows are exact duplicates – same name, same price - combine them by
adding a (x2) in front of the price. This line must show up exactly where the first item would have been.

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

comp.sci-python - For this option, first ask the user what the maximum number of...
computer science - I need to write a program that ask the student to enter an ...
programming - Using Raptor, create a condition loop that will ask the user for ...
math - There are 7 children who are 5ft long,their total length is 3ft longer ...
Literature - I am suppose to compare/contrast Monty Python and the Holy Grail ...
marketing opportunity cost - Maurice receives $100 as a birthday gift. In ...
principles of math 11 - if f(x)=2x =1 and g( x) =4x-3 then (f+g)(x)= options are...
Computer Programming - Java Programming Question: basically want to keep the ...
Language arts - Can someone give me an example of a metaphor? Is a mouse in ...
math - 6. A lottery offers two options for the prize. Option A: $1000 a week for...

Search
Members