Question

In: Computer Science

A discount store is having a sale where everything is 15% off. Write a program to...

A discount store is having a sale where everything is 15% off. Write a program to display a table showing the original price and the discounted price. This program requires no input and your table should include headings and the original prices should go from 99 cents to $9.99 in increments of 50 cents.

Python

Solutions

Expert Solution

Python code:

#printing the headers
print("Original price{:>10} Discounted price{:<15}".format(" "," "))
#initializing i as 0.99
i=0.99
#looping till i is 9.99
while(i<=9.99):
    #printing Original and Discounted price
    print("${:.2f}{:>20}${:.2f}{:<15}".format(i," ",i-i*0.15," "))
    #incrementing i with 0.5
    i+=0.5

Screenshot:


Output:


Related Solutions

A local department store is having a BOGOHO (Buy One, Get One Half Off) sale. The...
A local department store is having a BOGOHO (Buy One, Get One Half Off) sale. The manager wants a program that allows salesclerks to enter the prices of two items. The program should calculate and display the total amount the customer owes. The half-off should always be taken on the item having the lowest price. If the items cost $24.99 and $10, the half-off would be taken off the $10 item. If both prices are equal, take the half-off on...
Bookstore Sale The SOU’s bookstore is having a student appreciation sale. Students will receive a discount...
Bookstore Sale The SOU’s bookstore is having a student appreciation sale. Students will receive a discount on all nontextbook items, depending on the total spent on those items. Discounts will be applied as follows: $0 - $50.99 4% $51.00 - $60.99 5% $61.00 - $70.99 6% $71.00 – $80.99 7% $81.00 – $90.99 8% $91.00 – $100.99 9% $101.00 or more 10% Regular prices Book Bags $40 Sweatshirts $20 Magazines $3 Notebooks $2 Candy $1 Spreadsheet will show the sales...
An office furniture store is having a sale on a certain type of office chair. The...
An office furniture store is having a sale on a certain type of office chair. The chairs are priced at GH¢800 per chair. The probability distribution for the number of chairs sold to an individual customer is Number of chairs 1 2 3 4 Probability 0.15 0.40 0.10 0.35 a) Find the probability that the number of chairs sold to an individual customer is odd. b) Find the expected number and standard deviation of chairs sold to an individual customer....
A retail store is having a sale. A shopper wanting two medium shirts heads for the...
A retail store is having a sale. A shopper wanting two medium shirts heads for the sales rack, which is a mess, with sizes jumbled together. Hanging on the rack are 4 medium, 11 large, and 5 extra-large shirts. Find the probability of each event described. (a) The first two shirts hehe grabs are the wrong size. (b) The first medium shirt hehe finds is the third one hehe checks. (c) The first four shirts hehe picks are all extra-large....
Write a C program that asks the user to enter 15 integer numbers and then store them in the array.
Write a C program that asks the user to enter 15 integer numbers and then store them in the array. Then, the program will find the second largest element in array and its index without sorting the array. For example, In this array {-55,-2,1, 2, -3, 0, 5, 9, 13, 1, 4, 3, 2, 1, 0}, the second largest element is 9 [found at index 7].
A program was created to randomly choose customers at a clothing store to receive a discount....
A program was created to randomly choose customers at a clothing store to receive a discount. The program claims 22% of the receipts will get a discount in the long run. The owner of the clothing store is skeptical and believes the program's calculations are incorrect. He selects a random sample and finds that 17% received the discount. The confidence interval is 0.17 ± 0.05 with all conditions for inference met. Part A: Using the given confidence interval, is it...
A program was created to randomly choose customers at a shoe store to receive a discount....
A program was created to randomly choose customers at a shoe store to receive a discount. The program claims 15% of the receipts will get a discount in the long run. The manager of the shoe store is skeptical and believes the program's calculations are incorrect. She selects a random sample and finds that 12% received the discount. The confidence interval is 0.12 ± 0.05 with all conditions for inference met. Part A: Using the given confidence interval, is it...
A program was created to randomly choose customers at a clothing store to receive a discount....
A program was created to randomly choose customers at a clothing store to receive a discount. The program claims 22% of the receipts will get a discount in the long run. The owner of the clothing store is skeptical and believes the program's calculations are incorrect. He selects a random sample and finds that 17% received the discount. The confidence interval is 0.17 ± 0.05 with all conditions for inference met. Part A: Using the given confidence interval, is it...
Write a program to store record of 15 Facebook users using Dictionary data type. Actual name...
Write a program to store record of 15 Facebook users using Dictionary data type. Actual name record should hold username, number of friends, place, date of birth and the date their account was created. https://realpython.com/python-lists-tuples/ https://realpython.com/python-dicts/
IN PYTHON: Write a program to study countries and their capitals. The program will store country:capital...
IN PYTHON: Write a program to study countries and their capitals. The program will store country:capital information and allow the user to quiz themselves. These two functions are required for this assignment. You may add other functions that you deem appropriate: - menu()   This function, which displays all the user options to the screen, prompts the user for their choice and returns their choice. This function will verify user input and ALWAYS return a valid choice. - addCapital(dict) This function...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT