DCP-166: POS System Back to All Problems

Beginner Beginners Problems > Ad-hoc

Now a days POS (Point of sales) systems are becoming very common in our country. You will find them in almost every shop in the major cities. These are the system in the cash counter where the sales person enters detail of your purchased products either manually or through scanning machine and the system automatically calculates the total amount. This helps in quick sale and thus shops can provide better customer service. This system is an essential part of growing business. Not only this helps in quick sales, but it also keeps track of every sale made in great detail. It can later help the shop owner to understand the profit margin of the business. It can also give an idea which product is in demand and when it is in demand. In summary this provides great business intelligence. In this problem, we are going to write a simple POS system total amount calculation logic, so that we can integrate that in a POS system in future. You are the programmer who is assigned to complete this important task. Let's do it. Input: ------ Input starts with an integer **T (1 <= T <=50)**, denoting the number of test cases. Each case starts with an integer **N (1 ≤ N ≤ 20)** denoting the number of items purchased. The next N lines will contain two number P and Q separated by space, denoting the unit price of an item and quantity purchase of that item. Here **P (1.00 ≤ P ≤ 2000.00)** is always a real number and **Q (1 ≤ Q ≤ 20)** is always a whole number. Each test case ends with an integer **G (1 ≤ G ≤ 2<sup>31</sup>-1)** that denotes the cash amount given by the customer to sales person. This amount will always be greater than or equal to the total amount of purchase. Output: ------- For each case of input, print the case number as "**Case #:** " and output the amount to be returned by the sales person to customer in single line. You can assume this amount will always be less than 1000.00. In case the return amount is fractional (i.e 115.73), the sales person will only return the whole amount (115) and discard the fractional amount (0.73). *Please check the sample input/output for better understanding of format.* Sample Input ------------ 3 2 500.00 2 30.00 1 1100 1 45.80 2 500 3 99.99 4 1.50 2 33.33 3 1000 Sample Output ------------- Case 1: 70 Case 2: 408 Case 3: 497

Problem Setter:

MD. Jalal Uddin

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 3.00
Go 3.00
Java 3.00
JavaScript 3.00
Objective-C 3.00
Perl 3.00
PHP 3.00
Python 3.00
Python3 3.00
Ruby 3.00
VB.Net 3.00

Problem Stats




# User Language Timing
01 joy25896 Cpp14 0.00s
02 emrul Cpp14 0.00s
03 Ashish972 Cpp14 0.00s
04 Brokenlog Cpp14 0.00s
05 Indro_BU Cpp14 0.00s
06 TalukderMuhammad Cpp14 0.00s
07 The_Viper Cpp14 0.00s
08 gulzar Cpp14 0.00s
09 Avijeet Cpp14 0.00s
10 burhan103335 Cpp14 0.00s
11 Nazmul0092 Cpp14 0.00s
12 Mr_KAJOL Cpp14 0.00s
13 atikhashmee Cpp14 0.00s
14 giash_uddin Cpp14 0.00s
15 SakibAlamin Cpp14 0.00s
16 Mhkhaled Cpp14 0.00s
17 Alamgir_Hossain Cpp14 0.00s
18 smriad Cpp14 0.00s
19 Saimum_140128 Cpp14 0.00s
20 jayed_al_hasan Cpp14 0.00s
21 lolcoder Cpp14 0.00s
22 soumitro_cse1604114 Cpp14 0.00s
23 Nabila_ Cpp14 0.00s
24 Nijhum1604125 Cpp14 0.00s
25 MUKTO1604100 Cpp14 0.00s
26 deder Cpp14 0.00s
27 jualahmed Cpp14 0.00s
28 JubayerSohel Cpp14 0.00s
29 Nusrat_cse16 Cpp14 0.00s
30 shibli1604128 Cpp14 0.00s
31 Shibly1604111 Cpp14 0.00s
32 1604131 Cpp14 0.00s
33 Nasif Cpp14 0.00s
34 CSE1604076_nafiul Cpp14 0.00s
35 esha1604103 Cpp14 0.00s
36 gourob1604097 Cpp14 0.00s
37 Alamgir_1604069 Cpp14 0.00s
38 shifat1604112 Cpp14 0.00s
39 nurul_islam Cpp14 0.00s
40 1604099_ishtiaq Cpp14 0.00s
41 Rifat121 Cpp14 0.00s
42 Sudipta_Nath Cpp14 0.00s
43 virus C 0.00s
44 feodorv C 0.00s
45 mahathir C 0.00s
46 opu1604073 C 0.00s
47 cinmoy98 C 0.00s
48 CSE1604084_Mahir C 0.00s
49 pulak_ict_mbstu Cpp14 0.00s
50 ashish_pondit C 0.00s

Your feedback is our precious!

Or call +88 02 9853138 for support