Thursday
August 21, 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

Computer science - Take two inputs from user: N - #items B - budget. There are S...
programming logic - The program will accept user input to store the student's ...
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. ...
math - Bill buys x items at $3 each, y items at $5 each, and z items at 6 each. ...
computer science - Python 3 For this option, you will first ask "how many rows...
Home Economics - What is the difference between facing and interfacing? Name two...
Programming in Python - A customer in a store is purchasing five items. Design a...
Statistics Help please - Is Scanner Accuracy the Same for Specials? In a study ...
programming - 3. Write a structured algorithm that prompts the user to input the...

Search
Members