.Assume that there is a little Boy named Johny, who is very playful and always gets into some trouble. Like that, One day Johny came earlier from school and started playing in his farm house. while he was hiding inside the motor room, his parents locked all the doors and…