Suppose that you have to implement a class named Dragonball. This class must have an attribute named ballCount (which starts from 0) and 2 methods iFoundaBall and iLostball. When iFoundaBall is called, ballCount is increased by one. When ilostball is called a a random number between 0 to ball count is chosen and subtracted from ball count. If the value of ballCount is equal to seven, then the message You can ask your wish is printed, and ballCount is reset to 0.
0 Answer(s)