Question: Question 1: Write a java program for a simple calculator. The program accept two numbers from user. The program consists from four classes are add,

Question 1: Write a java program for a simple calculator. The program accept two numbers from user. The program consists from four classes are add, sub, mul and div. For each class, two constructors, first with no argument and second with argument. Add class for addition to get addition of two numbers, it include two methods: 1. Operation method with two parameters 2. To print result and to give a description for the method Sub class to do subtraction and it's inherit from Add class and it include 1. Operation method with two parameters 2. To print result and to give a description for the method 3. Overriding the print method show it for subtraction Mul class to do multiplications and it's inherit from sub class and it include 1. Operation method with two parameters 2. To print result and to give a description for the method 3. Overriding the print method show it for multiplication div class to do division and it's inherit from mul class and it include 1. Operation method with two parameters 2. To print result and to give a description for the method 3. Overriding the print method show it for division Write the main methods to show the results for each class and description for the method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
