Go to Top

Wednesday, 2 November 2011

Utilities 20 : Old style calculator

This is a kind of an old style calculator. You have to enter a number then enter the sign then the number and so on. This isn't one of my best programs, but it doesn't pay to hide it.

Java Program :

import java.io.*;
class calculator_working_edition
 static void main()throws IOException
     BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
     double a,b=0;
     String q;
     char o='a',opt='b';
     System.out.print("Enter the number : ");
         System.out.print("Enter option : ");
         break loop1;
            System.out.print("\nEnter the number : ");
             case '+':
             case '-':
             case '/':
             case '*':
             case '!':
             System.out.println("\nInvalid input");
        System.out.println("\nThe result is : "+a+"\n");
        System.out.println("Thank you for using this short program");
I will be working on a new calculator this time. So keep on a lookout for that one.

No comments:

Post a Comment