Write a program to check the current battery power level after every application and if the battery has 15% power or less (because it is an айphone), print on the console the percentage left and count of application remaining. If the battery has died display on the console the message “Phone Off”. If all applications have executed successfully and the battery has more than 15% power left, display - successful complete and percentage battery left.
On first line you will receive battery percentage left on start in format [number%]
On every next line you will receive string in format [applicationName]_[number%] till read the string “END” for stop the program. The “END” string could be “enD”, “eNd”, etc.
The input will always be valid and in the format described, there is no need to check it explicitly.
*If battery is 15% or less “Connect charger -> X%” and on new line “Programs left -> N” - where “X” is percentage left and “N” is program left to execute.
*If battery is 0 or less display: “Phone Off”.
*If execute all applications and battery have more than 15%. “Successful complete -> N%” N – is remaining power.
Starting percentage is an integer number in range [1..100]
Application name will always contains Latin letters only
Percentage will always be a 2 digit number in range [01..99] (always will have 2 digits! And % after that)
Allowed working time: 0.2 seconds. Allowed memory: 16 MB.