Computer Project Grade 10 Calculator
Computer Project Grade 10 Calculator
Computer Project Grade 10 Calculator
PROJECT
YEAR: 2018-19
GRADE :X
ROLL NO : 30
TOPICS : PROJECT
1
CALCULATOR
ACKNOWLEDGEMENT
2
First and foremost, I would like to thank the ICSE board for
giving me this wonderful opportunity to do this project. It has
truly been an efficacious experience.
Last but definitely not the least; I would like to thank my family
for their unfailing support and endorsement throughout.
INDEX
3
SERIAL.N TOPIC Page No
O
SYNOPSIS
1. I. OBJECTIVE 5
II. INTRODUCTION 5
III. WHY DID I DO 5
THIS PROGRAM
2. JAVA
PROGRAMMING 6
LANGUAGE
WHY DID I USE JAVA
3. FEATURES USED
I. DO-WHILE LOOP 6
II. SWITCH CASE 6
6
III. HARDWARE 6
REQUIREMENT
IV. SOFTWARE
REQUIREMENT
4. PACKAGES USED 7
5. ALGORITHM 7
6. PROGRAM 8
7. SCREENSHOT 16
USER MANUAL
8. I. STEP BY STEP 18
GUIDE
4
9. BIBLIOGRAPHY 19
SYNOPSIS
OBJECTIVE
INTRODUCTION
Calculator is one of the most simple device used for mathematical calculations
such as addition,subtraction etc.
There are several details that the user would have to enter, such as:
Calculator is one of the most popular devices used across the world.I wanted to
create a calculator in a program which would help users to just input data and
receive output.
5
Java is a programming language (Technology). It was first developed by James
Gosling at Sun Microsystems, which is now a part ofOracle Corporation. It was
released in 1995 as a part of Sun Microsystems' Java platform. The language has
developed much of itssyntax from C and C++. Java can run on many
different operating systems. This makes Java platform independent. Java does this
by making the Javacompiler turn code into Java bytecode instead of machine code.
This means that when the program is executed, the Java Virtual Machine interprets
the bytecode and translates it into machine code.
FEATURES USED
1. Do- while loop-It is used to keep the program running as long as the user
wants to.
2. Switch case-It helps in functioning the program according to the users
choice.
Hardware requirements
6
Software requirements
PACKAGES USED
For my project I used java.util package. I used “util” package in order to utilize its
features,especially it’s input features.
ALGORITHM
STEP 1:Start of algorithm
STEP 2:The program offers the user to choose any function among fourteen of
them.
STEP 3:The program then asks the user to enter to enter the set of values.
STEP 4:The output of the program will be visible in the output screen.
STEP 5:The program offers the user the option to use the calculator again or exit.
STEP 6:Depending on the output of the user the program exits or offers the user to
use the calculator again
7
PROGRAM
importjava.util.*;
importjava.math.*;
class Calculator
while(Exit==0)
System.out.print('\f');
System.out.println("--------------------------------------------------------------------------");
System.out.println();
8
System.out.println("5.Squaring a number 12.Finding the smaller of two numbers");
System.out.println("7.Finding a number's square root 14.Finding the absolute value of a number ");
System.out.println();
Ch = in.nextInt();
switch(Ch)
case 1:
N1 = in.nextDouble();
N2 = in.nextDouble();
break;
case 2:
N1 = in.nextDouble();
N2 = in.nextDouble();
break;
9
case 3:
System.out.println("Enter 2 numbers.");
N1 = in.nextDouble();
N2 = in.nextDouble();
break;
case 4:
N1 = in.nextDouble();
N2 = in.nextDouble();
System.out.println("Quotient: "+(N1/N2));
System.out.println("Quotient: "+(N1%N2));
break;
case 5:
System.out.println("Enter a number.");
N1 = in.nextDouble();
System.out.println("Square of N1 = "+(N1*N1));
break;
10
case 6:
N1 = in.nextDouble();
N2 = in.nextDouble();
break;
case 7:
System.out.println("Enter a number.");
N1 = in.nextDouble();
break;
case 8:
System.out.println("Enter a number.");
N1 = in.nextDouble();
break;
case 9:
System.out.println("Enter an angle.");
11
N1 = in.nextDouble();
else
break;
case 10:
System.out.println("Enter an angle.");
N1 = in.nextDouble();
else
break;
12
case 11:
System.out.println("Enter an angle.");
N1 = in.nextDouble();
else
break;
case 12:
N1 = in.nextDouble();
N2 = in.nextDouble();
if(N1<N2)
else if(N1>N2)
13
System.out.println(N2+ " is smaller.");
else
break;
case 13:
N1 = in.nextDouble();
N2 = in.nextDouble();
if(N1<N2)
else if(N1>N2)
else
14
}
break;
case 14:
System.out.println("Enter a number.");
N1 =in.nextDouble();
break;
default:
break;
System.out.println();
Exit = in.nextInt();
if(Exit!=0)
break; }
System.exit(0);}}
15
SCREENSHOT
OUTPUT SCREEN
16
17
USER MANUAL
1. Choose the function which you wish to perform from the list.
2. Enter the number of the function which it corresponds to.
3. Enter a value or a set of values depending on the function.
18
4. You’ll get your desired result.
5. Press 0 to use the calculator again or enter any other number to exit.
BIBLIOGRAPHY
https://www.geeksforgeeks.org/java/
https://www.javatpoint.com/java-programs
19
TEACHER’S REMARKS
1. Examiner I:
2. Examiner II:
3. Total Marks:
Principal’s Signature
20