Thursday
April 2, 2015

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

computers - compute the unit price for products sold the program should input ...
math - Bill buys x items at $3 each, y items at $5 each, and z items at 6 each. ...
Computer science - Take two inputs from user: N - #items B - budget. There are S...
math - Bill buys x items at $3 each, y items at $5 each, and z items at 6 each. ...
math - A manufacturer of lapel buttons test marketed a new item at a university...
programming - write a pseudocode to accept item name, price, and quality from a ...
programming - 3. Write a structured algorithm that prompts the user to input the...
programming - Create an application in C# that will accept sales information and...
computer science - Python 3 For this option, you will first ask "how many rows...
Pre-Calculus - It has been found that the supply of golf clubs varies linearly ...

Members