50% found this document useful (2 votes)
2K views1 page

CPP 05 PDF

The document describes a program that takes a price as input, formats it to 2 decimal places, and outputs the price in the sentence "The price is [price]". It provides examples of input/output pairs where prices of 24.5912 and 34.1754 are formatted to 24.59 and 34.18 respectively and output in the specified sentence format. A test case with expected input of 34.1754 and output of "The price is 34.18" is also given.

Uploaded by

bhuvangates
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
2K views1 page

CPP 05 PDF

The document describes a program that takes a price as input, formats it to 2 decimal places, and outputs the price in the sentence "The price is [price]". It provides examples of input/output pairs where prices of 24.5912 and 34.1754 are formatted to 24.59 and 34.18 respectively and output in the specified sentence format. A test case with expected input of 34.1754 and output of "The price is 34.18" is also given.

Uploaded by

bhuvangates
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Price Precision

The price P of an item is passed as the input. The program must print the value of P, formatting it up
to 2 places after decimal point. The output of the program must be "The price is P"

Example Input/Output 1:

Input:

24.5912

Output:

The price is 24.59

Example Input/Output 2:

Input:

34.1754

Output:

The price is 34.18

TestCase ID: 4665

Input:
34.1754
Expected Output:
The price is 34.18

B.BHUVANESWARAN | AP (SG) | CSE | Rajalakshmi Engineering College 5

You might also like