I am posting code snippet of a simple calculator which performs basic functions like add, subtract, divide, multiply of two numbers and also square, square root and cube of a number. No database is used for creating this calculator. A class named calc is defined in this which has the above said methods and when they are called the calculation is done according to them. It is really helpful for learning purpose. This code snippet teaches us how to create a class and methods and also how to call them.