Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

l Enumerate ways to collect data for evaluating HR performance.

Answered: 1 week ago

Question

What is focal length? Explain with a diagram and give an example.

Answered: 1 week ago

Question

What is physics and how does it apply in daily life?

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago