Elon Musk is on the expedition of sending another tesla with a robot this time to space. He has released his robot’s name as “IronRobot” but wants his robot’s version to be confidential and cannot be accessed directly. IronRobot’s initial version is 22 and the current version is being set only by the developer by using objects. It should not be accessed directly and should be encapsulated.
- Create class for Robot to read name and version
- Version should be a private variable
- Display the initial and current version of IronRobot
Input Format:
Read the current version,version
Constraint:
22<version<=100
Output Format:
Robot name
Initial Version
Current Version
Error if trying to access the private variable - version directly in code
Sample Input:
23
Sample Output:
IronRobot
22
23