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

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....
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 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....
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...
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...
write a c++ program using micro soft visual studio 2010 to write a program and store...
write a c++ program using micro soft visual studio 2010 to write a program and store 36 in variable x and 8 in variable y. add them and store the result in the variable sum. then display the sum on screen with descriptive text. calculate the square root of integer 36 in x. store the result in a variable. calculate the cube root of integer 8 in y. store result in a variable. display the results of square root and...
n-class: Write a program to store exam scores into a file. The program will ask the...
n-class: Write a program to store exam scores into a file. The program will ask the user how many exam scores to enter. Then it will ask the user for each exam score and store them in a file called scores.dat The file output should have the following format . Exam 1: 97 Exam 2: 85 C++ Coding please
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT