Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q1: Discount An item is on sale for 85% of its original Price. Given the original price of the item, calculate its sale price. Filename
Q1: Discount
An item is on sale for 85% of its original Price. Given the original price of the item, calculate its sale price.
Filename
Your filename for this question must be q1.py.
Input
- The first line contains the nonnegative integer number of dollars in the original price of the item. For example, if the item cost is 2 dollars and 10 cents, then this line is 2.
- The second line contains the integer number of cents (between 0 and 99) in the original price of the item. For example, if the item cost is 2 dollars and 10 cents, then this line is 10.
Output
Output the sale price of the item on one line in this format: the number of dollars, exactly one space, and the number of cents (between 0 and 99).
Algorithm
Here is the algorithm that you are required to use:
- Calculate the total number of cents that the item originally costs. For example, an item that costs 2 dollars and 10 cents costs 210 cents.
- Multiply that total number of cents by 85, then add 50, then divide by 100. This is the total number of cents in the sale price.
Sample Input 1
2
10
Sample Output 1
1 79
Sample Input 2
0
5
Sample Output 2
0 4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started