CodeGym /Courses /Java Collections /Big task: ATM software

Big task: ATM software

Java Collections
Level 9 , Lesson 15
Available

"Hi, Amigo!"

"Hello, Captain Squirrels, sir."

"You're a good student. Well done, soldier!"

"Today you have a new secret mission: master finances."

"Hooray!!! I already know what I'll spend the money on!!!"

"Don't relax yet, soldier! Mastering finances means writing a new secret ATM program.

Big task: ATM software - 1

"Go see Secret Agent IntelliJ IDEA. You'll receive all of the instructions there."

"It shall be done, Captain!"

10
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 1)
CashMachine (part 1)
10
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 2)
CashMachine (part 2)
20
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 3)
CashMachine (part 3)
40
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 4)
CashMachine (part 4)
20
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 5)
CashMachine (part 5)
20
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 6)
CashMachine (part 6)
20
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 7)
CashMachine (part 7)
40
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 8)
CashMachine (part 8)
40
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 9)
CashMachine (part 9)
40
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 10)
CashMachine (part 10)
40
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 11)
CashMachine (part 11)
40
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 12)
CashMachine (part 12)
40
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 13)
CashMachine (part 13)
40
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 14)
CashMachine (part 14)
10
Task
Java Collections, level 9, lesson 15
Locked
CashMachine (part 15)
CashMachine (part 15)
Comments (11)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
matemate123 Level 50, Kraków, Poland
13 December 2023
This is the first project in which I haven't gotten pissed off even once. My favorite besides 2048 game and LogParser. Learning with pleasure.
matemate123 Level 50, Kraków, Poland
13 December 2023
PS: What is curious is that I had a bug in the WithdrawCommand class, which the validator didn't see. I found it by accident, when I test Strings from withdraw_en.properties. In my program for example if you deposit two banknotes 200 USD, you have 400 USD. When you want deposit 300 USD you have insufficient banknotes for that but next step if you ask about withdraw 400, ATM machine don't have money too! A bug was because in my public Map<Integer, Integer> withdrawAmount(int expectedAmount) method I had improper initialization temporary map:

Map<Integer, Integer> temp = denominations;
It change temp map when it try check if it can withdraw 300 USD but it point to the same object like denominations map. And when next ask to withdraw 400 which it must be possible in that situation, then occurs I have only one banknote 200, not two. In previous checking method I lost one banknote because I override denominations map. Initialization must be:

Map<Integer, Integer> temp = new TreeMap<>(Comparator.comparingInt(Integer::intValue).reversed());
        temp.putAll(denominations);
Code Gym bosses please restrict Validator for that problem.
Andrei Level 41
4 August 2021
Just finished this task. Very nice task, I really enjoyed it, I managed to do about 70-80% on my own which is quite a nice feeling. BUT boy oh boy, the validator on this thing is all over the place... the task seems to have been updated lately but the validator / solution have not been and they offer contradictory information. For example, on one task 2 conditions weren't validating. even though I made perfectly one of them, it still didn't validate that respective condition. However, when I did the second one then they both validated; which is quite confusing because at no time did the validator mention that the 2 conditions are dependent on each other. So this sends you into a spinning cycle of trying to find out what is wrong with that condition, if you are trying to do the conditions one after the other. Also, I spent about 10 minutes on the last task, because the validator wasn't accepting a condition that I had to resolve from a completely different class which was related to the class from the condition... it made me want to pull out the hair from my head.
Justin Smith Level 41, Greenfield, USA, United States
7 June 2023
I'm actually quite stuck at this time due to the validator. The program works as requested, but the validator crashes when tested. I think at this point I may just move one, hoping I have enough dark matter to get through the next chapter.
Andrei Level 41
9 June 2023
I've come to the conclusion that between 20 to 40 minutes of racking my brain for a task is sufficient to help the learning process. After that I'd just check the solution, try my best to understand it and then try to apply it without copy pasting it. This in time creates the correct way of thinking and solving problems gets easier because patterns start to form.
Justin Smith Level 41, Greenfield, USA, United States
9 June 2023
Yeah, I do the same. And when I do that, I make sure to type out the code instead of copy/pasting, to help commit it to memory better. Also I sometimes tweak it a little bit to fit my own coding style, as long as I'm not functionally changing the code.
MaGaby2280 Level 41, Guatemala City, Guatemala
2 August 2021
This was a hard task... lots of reading required... Took five days to complete it, but now it it time to move on thank God!
Denys Pits Level 41, Ukraine
21 April 2021
14 task: Use "exact.amount.not.available" when you catch InsufficientFundsException. Use "not.enough.money" when !isAmountAvailable. You may have problems with WithdrawCommand connected with these two strings.
Juan Ma Level 1, Arauca, Colombia
4 July 2020
Task 9: In task 2 it says that InterruptedOperationException must be abstract, but to pass the third validator condition I had to remove it as abstract to pass. throw a new InterruptedOperationException (); instead of throw a new InterruptedOperationException () {};
fzw Level 41, West University Place, United States
13 May 2020
Task 10 We can't issue the same banknotes more than once, so if we find a valid option for issuing the money (item 2.1 is successful), then remove all these notes from the map in the manipulator. This does not mean we can only use at most 1 banknote of each domination to withdraw money! This simply means there is only one entry for each banknote in returned map.
Seb Level 41, Crefeld, Germany
28 February 2020
Not easy, but another really good task. Thanks, Captain! :-)