python 3

posted by .

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.

Similar Questions

hi why do brand names are dold at a higher price ?
2. math

Bill buys x items at \$3 each, y items at \$5 each, and z items at 6 each. If x,y,and z are each multiple of 5 and the total price of the items costing \$3 and \$5 is 55, which of the following could be the total price of all x +y+z items?
3. math

Bill buys x items at \$3 each, y items at \$5 each, and z items at 6 each. If x,y,and z are each multiple of 5 and the total price of the items costing \$3 and \$5 is 55, which of the following could be the total price of all x +y+z items?
4. programming

Create an application in C# that will accept sales information and calculate the total bill. There are 3 products which can be sold: Product 1 with price of \$2.98 Product 2 with price of \$4.50 Product 3 with price of \$9.75 The application …
5. programming

3. Write a structured algorithm that prompts the user to input the name and the price of an item and the quantity purchased. It should print the name, price, quantity and amount due with appropriate labels.
6. computers

compute the unit price for products sold the program should input the name and price of an item and its weight in pounds and ounces. Then it should determine and display the unit price write a pseudo code program that will allow a …
7. Computer science

Take two inputs from user: N - #items B - budget. There are S items, each with some price value, out of which user needs to select N items in such a way that total bill does not exceed B. The program should print all such combination …
8. programming

write a pseudocode to accept item name, price, and quality from a user and display the item name and it's total value. the total value can be calculated as the product of price and quality
9. Math

Mrs. Jacobson wants to order toy instruments to give as prizes to her music students. The table shows the prices for various order sizes. Whistles 25 items=\$21.25 50 items=\$36.00 80 items=\$60.00 Kazoos 25 items=\$10.0 50 items=\$18.50 …
10. Information Technology (Pascal algorithm)

Ask the user to enter the discount percentage(rate) offered in a sale Accept the discount percentage from the user Ask the user to enter the price for three different sales item Accept the prices of the three sale items Compute the …

More Similar Questions

Post a New Question