The input data should be read from the console. On the first line you will receive the money Lina has before the shopping starts. She will always receive only one command ”mall.Enter” and only one command “mall.Exit”. When you receive the command “mall.Enter” on every line you will start receiving strings containing information about the purchases/actions Lina plans to make, until you receive the command “mall.Exit”.
The output data should be printed on the console.
When the shopping ends you should print on the console the outputs depending on the number of purchases. If she didn’t make any purchases print:
If she has made at least one purchase, print:
Money should be formatted to the second digit after the decimal point.
- Money is a floating-point number in the range [0 - 7.9 x 1028].
- The number of strings between the enter and exit command will be in the range [1 - 20];
- The number of characters in the string representing the actions are in the range [1 - 20];
- Allowed working time: 0.1 seconds. Allowed memory: 16 MB.
|1 purchases. Money left: 80.00 lv.|| ‘d’ has ASCII code 100. It is lowercase, so Lina gets 70% discount of the price, 100 – 70% = 30. |
110 – 30 = 80 lv.
|1 purchases. Money left: 55.00 lv.|
|2 purchases. Money left: 58.10 lv.|