Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class tester
- {
- public static void main (String args []){
- Scanner in = new Scanner(System.in);
- double a,b;
- Calculator c1 = new Calculator ();
- Calculator c2 = new Calculator ("***NLCS CALCULATOR***");
- System.out.println(c1.getName());
- System.out.println("The result of 3 + 3 is "+c1.add(3,3));
- System.out.println("The result of 9 + 4 + 6 is "+c1.add(9,4,6));
- System.out.println(c2.getName());
- System.out.println("Enter the value of a.");
- a = in.nextDouble();
- System.out.println("Enter the value of b.");
- b = in.nextDouble();
- System.out.println("The result of " + a + " + " + b + " is "+c2.add(a,b));
- System.out.println("The result of " + a + " * " + b + " is "+c2.multiply(a,b));
- System.out.println("The result of " + a + " / " + b + " is "+c2.divide(a,b));
- System.out.println("The result of " + a + " % " + b + " is "+c2.modulus(a,b));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement