The programming language is Java Application here is the problem..for fun. :) just comment the codes below thanks :)
Create a program that the user display the following process below: (All text/message that has parenthesis. It means comment) Assume that once the program started. Battery consumption is 20 charge level then 0 for Load. And then maximum of Battery charge and Load is 20 only. LOAD TRANSACTION (display) [1] - Text [2] - Missed Call [3] - Call [4] - Reload [5] - Recharge [6] - Balance Inquiry [7] - Back to Menu [8] - Exit Enter MODE: 1 (user inputted) Sorry! You don't have enough balance. Pls reload. Enter MODE: 7 (user inputted) LOAD TRANSACTION (display) [1] - Text [2] - Missed Call [3] - Call [4] - Reload [5] - Recharge [6] - Balance Inquiry [7] - Back to Menu [8] - Exit Enter MODE: 5 (user inputted) Battery Full! (output) Enter MODE: 4 (user inputted) Reload... (output, load = 5) Enter MODE: 4 (user inputted) Reload... (output, load = 5 + 5 = 10) Enter MODE: 4 (user inputted) Reload... (output, load = 5 + 5 + 5 = 15) Enter MODE: 4 (user inputted) Reload... (output, load = 5 + 5 + 5 + 5 = 20) Enter MODE: 4 (user inputted) Maximum of 20 Load only! (output, load > 20, which is invalid.) Enter MODE: 6 (user inputted) Battery - 20 Load - 20 Enter MODE: 1 (user inputted) Texting... (output, it will less 1 for load and battery) Enter MODE: 3 (user inputted) Calling... (output, it will less 5 for load and battery) Enter MODE: 3 (user inputted) Calling... (output, it will less 5 for load and battery) Enter MODE: 3 (user inputted) Calling... (output, it will less 5 for load and battery) Enter MODE: 3 (user inputted) Sorry! You don't have enough balance. Pls reload. Battery empty! Pls recharge. (output. Because it will less another 5 again but the battery and load is not enough.) Enter MODE: 6 (user inputted) Battery - 4 Load - 4 Enter MODE: 8 (user inputted) THANK YOU! (exit)
CONDITIONS: Text - less 1 (-1) Missed Call - less 3 (-3) Call - less 5 (-5) Reload - plus 5 (+5) and not more than or greater than to 20. Recharge - plus 5 (+5) and not more than or greater than to 20.
Oh come on, none of you even gave advice? OP probably doesn't need it anymore since this was like a week ago, but it's not like they said to do it for them. There are ways to answer without copping out.
>>5 I did try. To be honest this is a bit above my level of knowledge. All I can see is a lot of if statements for a lot of different inputs. You could probably use recursion to make it nice and clean but I don't know how.