Professional Documents
Culture Documents
Minorproject SRS
Minorproject SRS
Minorproject SRS
SCIENTIFIC CALCULATOR
Submitted for partial fulfillment of the requirements for the of
BY
Department of BCA
Date:
ACKNOWLEDGEMENT
I would like to express my sincerest gratitude and
indebtedness to the person who gave me a moral and
technical support& whose kind assistance has been
instrumental in completion to this industrial training. It
gives me immense pleasure to own my humble
gratefulness to my faculty ‘Mr. Raj Kishor Chauhan’ for
this indispensable guidance and providing necessary
ideas and facilities to carry out this project.
Signature of Student
Vanshaj Arora
Varsha Chaurasia
LIST OF FIGURES
ABSTRACT
A scientific calculator is a device that can perform
various mathematical operations and functions, such as
trigonometry, logarithms, exponentiation, and more. The
aim of this project is to design and implement a scientific
calculator using HTML, CSS and Javascript
programming. The calculator will have a graphical user
interface (GUI). The calculator will also have standard
and scientific modes, which can be switched by the user.
The calculator will be able to handle different types of
inputs, such as integers, decimals, fractions, and
complex numbers, and display the results in different
formats, such as binary, octal, hexadecimal, and ASCII.
The calculator will also have error handling and
validation features, such as checking for invalid inputs,
division by zero, overflow, and underflow. The project
will demonstrate the use of built-in modules, as well as
external libraries, for performing various mathematical
computations. The project will also showcase the use of
object-oriented programming principles, such as
classes, inheritance, polymorphism, and encapsulation,
for designing and organizing the code. The project will
be tested and evaluated using various test cases and
scenarios, and the performance and accuracy of the
calculator will be compared with other existing
calculators. The project will also discuss the challenges,
limitations, and future scope of the scientific calculator.
TABLE OF CONTENTS
Page No.
Certificate ............................................................................................ i
Declaration........................................................................................... ii
Acknowledgements.............................................................................. iii
List of Figures....................................................................................... iv
List of Tables......................................................................................... v
Abstract................................................................................................. vi
CHAPTER 1
INTRODUCTION
1.1 Objectives
1.2 Problem specification
1.3 Methodologies
CHAPTER 2
LITERATURE REVIEW
CHAPTER 3
PROBLEM DEFINITION
•Modules and Their Functionalities
•Hardware/ Software Requirement
CHAPTER 4
SYSTEM DESIGN
•Data Flow Diagrams
•UML Diagrams
•ER Diagrams
CHAPTER 5
IMPLEMENTATION
CHAPTER 6
CONCLUSIONS & FUTURE ENHANCEMENTS
6.1 Observations
6.2 Result Analysis
6.3 Limitations
6.4 Future works
REFERENCES
APPENDIX
SAMPLE CODE SEGMENT
CHAPTER-1
INTRODUCTION
1.1 Objectives of the Project:
1.3 Methodologies:
A scientific calculator is an electronic device that can
perform various mathematical operations and functions,
such as arithmetic, trigonometry, exponentials, etc. To
develop a scientific calculator, one needs to follow a
systematic methodology that covers the following
stages:
Analysis: This stage involves defining the
problem, identifying the requirements, and
specifying the objectives and scope of the
project., and determining the target audience
and stakeholders of the project.
CHAPTER-2
LITERATURE REVIEW
A scientific calculator is an electronic device that can
perform various mathematical operations and functions,
such as arithmetic, trigonometry, exponentials, etc. They
are widely used by students, teachers, engineers,
scientists, and other professionals who need to perform
complex calculations quickly and accurately. However,
developing a scientific calculator is not a trivial task, as it
involves many challenges and considerations in terms of
design, implementation, evaluation, and usability. This
literature review aims to provide an overview of the
existing research on scientific calculators, and identify
the gaps and opportunities for future work.
The literature on scientific calculators can be divided into
four main categories:
Design, implementation, evaluation, and usability.
Each category covers different aspects and issues
related to the development and use of scientific
calculators.
CHAPTER-3
PROBLEM DEFINITION
A scientific calculator is a device that can perform
various mathematical operations and functions, such as
addition, subtraction, multiplication, division,
exponentiation, logarithms, trigonometry, and more. A
scientific calculator can help students and professionals
to solve problems that require quick and accurate
calculations. A scientific calculator can also display
numbers in different formats, such as scientific notation,
fractions, decimals, and binary.
A problem definition of a scientific calculator is a
statement that describes the purpose, scope, and
requirements of the device. A problem definition can
help to identify the goals, inputs, outputs, and functions
of the calculator. A problem definition can also specify
the design constraints, such as the size, shape, cost,
and power consumption of the calculator. A problem
definition can be written as follows:
CHAPTER-4
SYSTEM DESIGN
System design is the solution for the creation of a
new system. This phase focuses on the detailed
implementation of the feasible system. It emphasis
on translating design. Specifications to performance
specification. System design has two phases of
development:
Logical design
Physical design
CHAPTER-5
IMPLEMENTATION
https://www.slideshare.net/
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Scientific Calculator</title>
<title>Scientific Calculator</title>
</head>
<body>
<div class="container">
<div class="topBar">
<path
</svg>
</a> -->
<path
</svg>
</a>
</div>
<div class="calculator">
<div class="input-area">
<div id="topDisplay-container">
<div id="topDisplay"></div>
</div>
<input type="text" id="display" readonly value="0">
<div id="exponential-container">
×10<sup id="exponential"></sup>
</div>
</div>
<div class="button-container">
<div class="trigonometry">
<span id="trigonometric-mode"></span>
<span id="trigono-toggle">
<span>Trigonometry ↓</span>
<span id="trigonometric-container">
</span>
</span>
</span>
</span>
</span>
</span>
sin<sup>-1</sup>(</span>
cos<sup>-1</sup>(</span>
tan<sup>-1</sup>(</span>
</span>
</span>
</div>
<div class="button-area">
</span>
(</span>
</div>
</div>
</div>
</div>
</body>
</html>
--button-color: #2a2a2a;
--button-hover: #3d3d3d;
--max-width: 35rem;
font-size: 16px;
@font-face {
font-family: 'Charm';
font-style: normal;
font-weight: 400;
font-display: swap;
@font-face {
font-style: normal;
font-weight: 400;
font-display: swap;
@font-face {
font-family: 'Tangerine';
font-style: normal;
font-weight: 400;
font-display: swap;
*{
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
body {
background: var(--body-background);
margin: 0;
position: absolute;
width: 100%;
height: 100%;
min-width: 300px;
max-width: 100vw;
max-height: 100vh;
.container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.topBar {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
max-width: var(--max-width);
margin: auto;
.topBar svg {
width: 2.5vh;
height: 2.5vh;
.topBar svg:hover {
.signature {
font-size: 2.3vh;
font-weight: bold;
text-align: center;
text-decoration: none;
letter-spacing: 2px;
margin: 0;
.signature:hover {
text-decoration: underline;
.calculator {
flex-grow: 1;
width: 100%;
max-width: var(--max-width);
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
padding: 0 2.5vw;
margin: 0 auto;
.input-area {
color: white;
position: relative;
background: transparent;
width: 100%;
#topDisplay-container {
position: relative;
width: 100%;
height: 4.8vh;
margin: 1vh 0;
overflow-x: auto;
direction: rtl;
#topDisplay-container::-webkit-scrollbar {
display: none;
#topDisplay-container {
-ms-overflow-style: none;
/* IE and Edge */
scrollbar-width: none;
/* Firefox */
#topDisplay {
position: absolute;
right: 0;
background: transparent;
color: #dddddd;
font-size: 3.5vh;
height: 100%;
margin: 0;
direction: initial;
cursor: grab;
#display {
background: transparent;
width: 100%;
text-align: right;
font-size: 6vh;
border: 0;
outline: 0;
#exponential-container {
position: absolute;
right: 10px;
margin-top: 5px;
font-size: 1.1rem;
#exponential-container.active {
color: whitesmoke
.button-container {
width: 100%;
.trigonometry {
color: white;
font-size: 2.5vh;
cursor: pointer;
user-select: none;
}
#trigonometric-mode {
text-transform: capitalize;
margin-right: 0.8rem;
#trigono-toggle {
position: relative;
display: inline-block;
margin-top: 10px;
#trigonometric-container {
background: var(--button-color);
position: absolute;
top: 150%;
width: max-content;
display: grid;
z-index: 10;
transform: rotateX(90deg);
transform-origin: top;
#trigonometric-container.visible {
display: grid;
transform: rotateX(0);
.trigono-operator {
text-align: center;
padding: 15px;
.trigono-operator:hover {
background: var(--button-hover);
}
.button-area {
width: 100%;
background: transparent;
display: grid;
grid-gap: 5px;
border-bottom-left-radius: 10px;
.button {
color: white;
text-align: center;
font-size: 2.7vh;
background: var(--button-color);
justify-content: center;
align-items: center;
cursor: pointer;
border-radius: 5px;
user-select: none;
.button.click-animation {
@keyframes clickAni {
30% {
transform: scale(0.9);
background: var(--button-hover);
80% {
transform: scale(1.05);
background: var(--button-color);
}
.toggle-visibility {
display: none;
.toggle-visibility.visible {
display: inline-flex;
.button-pair {
display: grid;
grid-gap: 5px;
padding: 0 !important;
.paired-button {
background: var(--button-color);
#powerButton,
#squareBut,
#power-1 {
sup {
font-size: 0.7rem;
position: relative;
top: -5px;
z-index: 1;
sub {
position: relative;
top: 5px;
z-index: 1;
:root {
font-size: 18px;
:root {
font-size: 22px;
:root {
font-size: 25px;
document.getElementById('visibility-toggler').addEventListener('click', function () {
document.querySelectorAll('.toggle-visibility').forEach(element => {
element.classList.toggle('visible');
})
})
window.addEventListener('load', acFunc);
trigonometricMode.innerText = trigonoMode;
function calculate(equationArray) {
return eval(equationArray.join(''))
function updateScreen() {
topScreen.innerText = showOnScreen.join('');
acBut.addEventListener('click', acFunc);
function acFunc() {
calculation = [];
showOnScreen = [];
screen.value = 0;
updateScreen();
clearExponential();
delBut.addEventListener('click', () => {
calculation.pop();
showOnScreen.pop();
updateScreen();
})
trigonometricMode.addEventListener('click', trigonometricModeFunction);
function trigonometricModeFunction() {
trigonometricMode.innerText = trigonoMode;
trigonoToggle.addEventListener('click', () => {
document.getElementById('trigonometric-container').classList.toggle('visible');
})
let result;
result = 0;
return result;
result = 0;
return result;
return result;
result = operator(angle);
return result;
numBut.forEach(element => {
element.addEventListener('click', numButFunction);
})
function numButFunction(event) {
calculation.push(event.target.innerText);
showOnScreen.push(event.target.innerText);
updateScreen();
operationBut.forEach(element => {
element.addEventListener('click', operationButFunction);
})
function operationButFunction(event) {
calculation.push(event.target.dataset.buttonSymbol);
showOnScreen.push(event.target.innerText);
updateScreen();
numBut.forEach(element => {
element.removeEventListener('click', removeAns);
})
bracketBut.forEach(element => {
element.addEventListener('click', bracketFunc);
});
function bracketFunc(event) {
let bracketCount = 0;
calculation.push('*');
if (bracketCount == 0) { return }
calculation.push(event.target.innerText);
showOnScreen.push(event.target.innerText);
updateScreen();
numBut.forEach(element => {
element.removeEventListener('click', removeAns);
})
function autoCloseBracket() {
let startParenthesis = 0;
let endParenthesis = 0;
element = element.toString();
calculation.push(')');
calculation.push('power(');
showOnScreen.push(event.target.dataset.buttonSymbol);
updateScreen();
});
function powerFunction() {
if (calculation.includes('power(')) {
let powerStart, powerEnd; // keep the index of the number from where to start power function
if (calculation[calculation.indexOf('power(') - 1] == ')') {
let bracketCount = 0;
powerOf.unshift(calculation[i]);
if (bracketCount === 0) { break } // if start brackets are equal to end brackets then break this loop
else {
if (operators.includes(calculation[i])) { break }
powerOf.unshift(calculation[i]);
let bracketCount = 1;
power.push(calculation[i]);
if (bracketCount == 0) { break } // if start brackets are equal to end brackets break this loop
// calculate power
updateScreen();
});
updateScreen();
})
rootFunc(event, 'Math.sqrt(');
});
rootFunc(event, 'Math.cbrt(');
})
!operators.includes(calculation.slice(-1)) ?
calculation.push(`*${root}`)
: calculation.push(root);
showOnScreen.push(event.target.dataset.buttonSymbol);
updateScreen();
numBut.forEach(element => {
element.removeEventListener('click', removeAns);
})
equalBut.addEventListener('click', equalFunc);
function equalFunc() {
clearExponential();
autoCloseBracket();
powerFunction();
let answer;
try {
answer = calculate(calculation).toString();
if (!answer.includes('e') &&
answer.includes('.') &&
answer.slice(0, -1).split('.')[1].endsWith('000000')) {
} catch (error) {
return;
calculation = [answer];
showOnScreen = [answer];
localStorage.setItem('ans', answer);
if (answer.indexOf('e') != -1) {
exponentialNum.innerText = newAnswer[1];
exponentialNum.parentElement.classList.add('active');
answer = newAnswer[0];
screen.value = answer;
numBut.forEach(element => {
element.addEventListener('click', removeAns);
})
function removeAns(event) {
calculation = [];
showOnScreen = [];
updateScreen();
console.log('remove ans')
numBut.forEach(element => {
element.removeEventListener('click', removeAns);
})
numButFunction(event);
function clearExponential() {
exponentialNum.innerText = '';
exponentialNum.parentElement.classList.remove('active');
answerButton.addEventListener('click', () => {
calculation.push(answer);
showOnScreen.push('ANS');
updateScreen();
})
document.addEventListener('keydown', e => {
})
document.querySelectorAll('.button').forEach(button => {
button.addEventListener('click', () => {
button.classList.add('click-animation')
// button.style.backgroundColor = "#3d3d3d"
// button.style.transform = "scale(0.9)"
// setTimeout(() => {
// button.style.transform = "scale(1.05)"
// }, 90)
// setTimeout(() => {
// button.style.backgroundColor = "#2a2a2a"
// button.style.transform = "scale(1)"
// }, 150)
})
})