Rescued document
Rescued document
MICRO PROJECT
Mr.A.M.Gaikwad
in
Three Years Diploma computer Engineering & Technology of Maharashtra State Board of
Technical Education, Mumbai (Autonomous)
Certificate
//This is to certify that
semester of ____________________________Diploma.
INDEX
//
SR.NO Title Page .no
1. Introduction 4
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
2. Abstract 5
3. Source Code 6
4. Output 16
5. Conclusion 17
INTRODUCTION
A calculator is one of the most fundamental and widely used applications in computing, providing
users with the ability to perform basic arithmetic operations. With the growing reliance on digital
tools in everyday tasks, creating a simple yet efficient calculator program serves as a great
exercise in understanding key programming concepts. Java, being an object-oriented and
platform-independent programming language, is an ideal choice for building such applications due
to its versatility and wide range of libraries for GUI development.
This project focuses on developing a simple calculator using Java that can perform the four basic
arithmetic operations: addition, subtraction, multiplication, and division. The calculator will be
designed with a graphical user interface (GUI) using Java's Swing framework, which is part of the
Java Foundation Classes (JFC). Swing allows developers to create rich, interactive user interfaces
that are both easy to use and visually appealing.
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
The goal of this project is not only to create a functional calculator but also to provide an
opportunity to explore Java’s fundamental concepts, such as event handling, object-oriented
programming (OOP), and GUI development. The program will also incorporate basic error
handling to manage user input errors, such as division by zero or entering non-numeric values,
ensuring that the application remains robust and user-friendly.
By the end of this project, users will have a working calculator that can be used for everyday
arithmetic calculations, and developers will gain hands-on experience in creating interactive
applications with Java, laying a strong foundation for more advanced programming projects.
Abstract:
The objective of this project is to develop a simple calculator application using Java
programming. This calculator will be capable of performing basic arithmetic operations such
as addition, subtraction, multiplication, and division. The application will feature a
userfriendly graphical interface (GUI) designed using Java's Swing framework, allowing
users to input numbers and select operations intuitively. The program will include error
handling to manage invalid inputs, such as division by zero or non-numeric characters,
ensuring robustness. Additionally, the application will support basic functionalities like
clearing the screen and displaying the result of operations. This project aims to demonstrate
the practical use of Java in building interactive, user-centric applications, while reinforcing
core programming concepts such as object-oriented design, event handling, and GUI
development
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
Source Code:
String digitButtonText[] = {"7", "8", "9", "4", "5", "6", "1", "2", "3", "0", "+/-", "." };
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
/
String operatorButtonText[] = {"/", "sqrt", "*", "%", "-", "1/X", "+", "=" };
String memoryButtonText[] = {"MC", "MR", "MS", "M+" };
String specialButtonText[] = {"Backspc", "C", "CE" };
MyCalculator(String frameText)
{ super(frameText);
int tempX=TOPX,
y=TOPY;
displayLabel.setBo
unds(tempX,y,240,
HEIGHT);
displayLabel.setBa
ckground(Color.BL
UE);
displayLabel.setFor
eground(Color.WH
ITE);
add(displayLabel);
tempX=TOPX;
y=TOPY+2*(HEIGHT+V_SPACE);
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
/
for(int i=0; i<memoryButton.length; i++)
{
memoryButton[i]=new
MyMemoryButton(tempX,y,WIDTH,HEIGHT,memoryButtonText[i], this);
memoryButton[i].setForeground(Color.RED); y+=HEIGHT+V_SPACE;
}
for(int i=0;i<digitButton.length;i++)
{ digitButton[i]=new MyDigitButton(tempX,y,WIDTH,HEIGHT,digitButtonText[i],
this); digitButton[i].setForeground(Color.BLUE); tempX+=WIDTH+H_SPACE;
if((i+1)%3==0){tempX=digitX; y+=HEIGHT+V_SPACE;}
}
int opsX=digitX+2*(WIDTH+H_SPACE)+H_SPACE;
int opsY=digitY; tempX=opsX; y=opsY; for(int
i=0;i<operatorButton.length;i++)
{
tempX+=WIDTH+H_SPACE;
operatorButton[i]=new
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
/
MyOperatorButton(tempX,y,WIDTH,HEIGHT,operatorButtonText[i], this);
operatorButton[i].setForeground(Color.RED); if((i+1)%2==0){tempX=opsX;
y+=HEIGHT+V_SPACE;}
}
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent ev)
{System.exit(0);}
});
setLayout(null);
setSize(FRAME_WIDTH,FRAME_HEIGHT); setVisible(true);
}
{
String resText=""+temp; if(resText.lastIndexOf(".0")>0)
resText=resText.substring(0,resText.length()-2); return
resText;
}
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
if(tempText.equals("."))
{ if(cl.setClear
)
{cl.displayLabel.setText("0.");cl.setClear=false;} else
if(!isInString(cl.displayLabel.getText(),'.'))
cl.displayLabel.setText(cl.displayLabel.getText()+".");
return;
}
int index=0;
try{ index=Integer.parseInt(tempText);
}catch(NumberFormatException e){return;}
if(cl.setClear)
{cl.displayLabel.setText(""+index);cl.setClear=false;} else
cl.displayLabel.setText(cl.displayLabel.getText()+index);
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
/
}
}
addActionListener(this);
}
cl.setClear=true; double
temp=Double.parseDouble(cl.displayLabel.getText());
if(opText.equals("1/x"))
{
try
{double tempd=1/(double)temp;
cl.displayLabel.setText(MyCalculator.getFormattedText(tempd));}
catch(ArithmeticException excp)
{cl.displayLabel.setText("Divide by 0.");}
return;
}
if(opText.equals("sqrt"))
{
try
{double tempd=Math.sqrt(temp);
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
/
cl.displayLabel.setText(MyCalculator.getFormattedText(tempd));}
catch(ArithmeticException excp)
{cl.displayLabel.setText("Divide by 0.");}
return;
}
if(!opText.equals("="))
{
cl.number=temp;
cl.op=opText.charAt(0);
return;
}
switch(cl.op)
{ case
'+':
temp+=cl.number;break; case
'-':
temp=cl.number-temp;break; case
'*':
temp*=cl.number;break; case
'%':
try{temp=cl.number%temp;}
catch(ArithmeticException excp)
{cl.displayLabel.setText("Divide by 0."); return;}
break; case
'/':
try{temp=cl.number/temp;}
catch(ArithmeticException excp)
{cl.displayLabel.setText("Divide by 0."); return;}
break;
}
cl.displayLabel.setText(MyCalculator.getFormattedText(temp));
}
}
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
this.cl.add(this); addActionListener(this);
}
cl.setClear=true; double
temp=Double.parseDouble(cl.displayLabel.getText());
switch(memop)
{ case
'C':
cl.memLabel.setText(" ");cl.memValue=0.0;break; case
'R':
cl.displayLabel.setText(MyCalculator.getFormattedText(cl.memValue));break; case
'S':
cl.memValue=0.0; case
'+':
cl.memValue+=Double.parseDouble(cl.displayLabel.getText());
if(cl.displayLabel.getText().equals("0") || cl.displayLabel.getText().equals("0.0") )
cl.memLabel.setText(" ");
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
/
else
cl.memLabel.setText("M"); break;
}
}
} class MySpecialButton extends Button implements
ActionListener
{
MyCalculator cl;
MySpecialButton(int x,int y, int width,int height,String cap, MyCalculator clc)
{ super(cap);
setBounds(x,y,width,height);
this.cl=clc; this.cl.add(this);
addActionListener(this);
} static String backSpace(String
s)
{
String Res=""; for(int i=0; i<s.length()-1; i++)
Res+=s.charAt(i); return Res;
}
if(opText.equals("Backspc"))
{
String tempText=backSpace(cl.displayLabel.getText());
if(tempText.equals(""))
cl.displayLabel.setText("0");
else
cl.displayLabel.setText(tempText);
return; }
if(opText.equals("C"))
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
/
{ cl.number=0.0; cl.op=' ';
cl.memValue=0.0; cl.memLabel.setText("
");
} cl.displayLabel.setText("0");cl.setClear=true;
}
}
OUTPUT:-
/
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
CONCLUSION
Creating a calculator in Java involves understanding fundamental programming concepts such as
control flow, user input handling, and basic arithmetic operations. Here's a high-level overview of the
key components involved:
1桷.Q萏֠葞֠࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀĀĀȀĀ儀ࠀༀ炄师炄㔈 ࠶㜀⨾䈀Ī䩃⩈伀J倀J
儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏ୀ葞ୀ ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ̀ĀЀĀ儀ࠀༀႄ帎ႄ㔎 ࠶㜀⨾䈀Ī䩃⩈
伀J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊ 桷Q萏რ葞რ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀԀĀĀ儀ࠀༀ낄帓낄㔓 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊ 桷Q萏 葞 ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ܀ĀȀĀ儀ࠀༀ傄帙傄㔙 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊ 桷⚡㗐早㖺✺å儌q則Ä䃿ᐂ猀5倀@ǿ܀唀渀欀渀漀眀渀ǿࠀǿǿÿȀÿÿȀÿ䜀逞ȀԃԄ̂$
.寠xী吀椀洀攀猀 一攀眀 刀漀洀愀渀㔀逞ȁԀąĂ؇Ԃ匀礀洀戀漀氀㌀逮Ȁ؋ȄȂȂ$.寠xী 䄀爀椀愀氀㜀逮ȀԏȂЂȃ$
.篤$ূ䌀愀氀椀戀爀椀䌀ⰮȀ̏ȂЂȃ$.篤$ূ 䌀愀氀椀戀爀椀 䰀椀最栀琀䄀逞ȀԄԃȃ$¢$B鼀䌀愀洀戀爀椀愀 䴀愀琀栀
∀Ѐ耈탰栀耀쮅胇쮅ÇĀȀ퐀 ꄀ,ကᨀЀ̀徐ᤀ尀/ကᨀ攀ĀჰĀ需ḅ됅됀脀ẁ0嬀4嬀4Ȁ荃ჰࠀ耀䀀PऀP ソソソソソソ䝿쑒㈀
⌀ကԀ砀砀ꀀ Input Handling: You'll need to capture user input using a Scanner object for reading numbers
and the operator from the console. This is essential for getting the necessary data to perform
calculations.
2桷.Q萏֠葞֠࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀĀĀȀĀ儀ࠀༀ炄师炄㔈 ࠶㜀⨾䈀Ī䩃⩈伀J倀J
儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏ୀ葞ୀ ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ̀ĀЀĀ儀ࠀༀႄ帎ႄ㔎 ࠶㜀⨾䈀Ī䩃⩈
伀J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊ 桷Q萏რ葞რ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀԀĀĀ儀ࠀༀ낄帓낄㔓 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊ 桷Q萏 葞 ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ܀ĀȀĀ儀ࠀༀ傄帙傄㔙 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊ 桷⚡㗐早㖺✺å儌q則Ä䃿ᐂ猀5倀@ǿ܀唀渀欀渀漀眀渀ǿࠀǿǿÿȀÿÿȀÿ䜀逞ȀԃԄ̂$
.寠xী吀椀洀攀猀 一攀眀 刀漀洀愀渀㔀逞ȁԀąĂ؇Ԃ匀礀洀戀漀氀㌀逮Ȁ؋ȄȂȂ$.寠xী 䄀爀椀愀氀㜀逮ȀԏȂЂȃ$
.篤$ূ䌀愀氀椀戀爀椀䌀ⰮȀ̏ȂЂȃ$.篤$ূ 䌀愀氀椀戀爀椀 䰀椀最栀琀䄀逞ȀԄԃȃ$¢$B鼀䌀愀洀戀爀椀愀 䴀愀琀栀
∀Ѐ耈탰栀耀쮅胇쮅ÇĀȀ퐀 ꄀ,ကᨀЀ̀徐ᤀ尀/ကᨀ攀ĀჰĀ需ḅ됅됀脀ẁ0嬀4嬀4Ȁ荃ჰࠀ耀䀀PऀP ソソソソソソ䝿쑒㈀
⌀ကԀ砀砀ꀀ Basic Arithmetic Operations: The core functionality of the calculator involves performing
addition, subtraction, multiplication, and division based on user input. These operations can be
implemented using if-else or switch-case statements to handle different operator choices.
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
/
3桷.Q萏֠葞֠࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀĀĀȀĀ儀ࠀༀ炄师炄㔈 ࠶㜀⨾䈀Ī䩃⩈伀J倀J
儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏ୀ葞ୀ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ̀ĀЀĀ儀ࠀༀႄ帎ႄ㔎 ࠶㜀⨾䈀Ī䩃⩈
伀J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏რ葞რ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀԀĀĀ儀ࠀༀ낄帓낄㔓 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏 葞 ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ܀ĀȀĀ儀ࠀༀ傄帙傄㔙 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷⚡㗐早㖺✺å儌q則Ä䃿ᐂ猀5倀@ǿ܀唀渀欀渀漀眀渀ǿࠀǿǿÿȀÿÿȀÿ䜀逞ȀԃԄ̂$
.寠xী吀椀洀攀猀 一攀眀 刀漀洀愀渀㔀逞ȁԀąĂ؇Ԃ匀礀洀戀漀氀㌀逮Ȁ؋ȄȂȂ$.寠xী䄀爀椀愀氀㜀逮ȀԏȂЂȃ$
.篤$ূ䌀愀氀椀戀爀椀䌀ⰮȀ̏ȂЂȃ$.篤$ূ䌀愀氀椀戀爀椀 䰀椀最栀琀䄀逞ȀԄԃȃ$¢$B鼀䌀愀洀戀爀椀愀 䴀愀琀栀
∀Ѐ耈탰栀耀쮅胇쮅ÇĀȀ퐀 ꄀ,ကᨀЀ̀徐ᤀ尀/ကᨀ攀ĀჰĀ需ḅ됅됀脀ẁ0嬀4嬀4Ȁ荃ჰࠀ耀䀀Pऀ ソソソソソソ䝿쑒㈀
P
⌀ကԀ砀砀ꀀ Error Handling: To improve the user experience, ensure proper error handling, such as
checking for division by zero and invalid input. This can be done through exception handling
mechanisms like try-catch blocks.
4桷.Q萏֠葞֠࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀĀĀȀĀ儀ࠀༀ炄师炄㔈 ࠶㜀⨾䈀Ī䩃⩈伀J倀J
儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏ୀ葞ୀ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ̀ĀЀĀ儀ࠀༀႄ帎ႄ㔎 ࠶㜀⨾䈀Ī䩃⩈
伀J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏რ葞რ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀԀĀĀ儀ࠀༀ낄帓낄㔓 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏 葞 ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ܀ĀȀĀ儀ࠀༀ傄帙傄㔙 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷⚡㗐早㖺✺å儌q則Ä䃿ᐂ猀5倀@ǿ܀唀渀欀渀漀眀渀ǿࠀǿǿÿȀÿÿȀÿ䜀逞ȀԃԄ̂$
.寠xী吀椀洀攀猀 一攀眀 刀漀洀愀渀㔀逞ȁԀąĂ؇Ԃ匀礀洀戀漀氀㌀逮Ȁ؋ȄȂȂ$.寠xী䄀爀椀愀氀㜀逮ȀԏȂЂȃ$
.篤$ূ䌀愀氀椀戀爀椀䌀ⰮȀ̏ȂЂȃ$.篤$ূ䌀愀氀椀戀爀椀 䰀椀最栀琀䄀逞ȀԄԃȃ$¢$B鼀䌀愀洀戀爀椀愀 䴀愀琀栀
∀Ѐ耈탰栀耀쮅胇쮅ÇĀȀ퐀 ꄀ,ကᨀЀ̀徐ᤀ尀/ကᨀ攀ĀჰĀ需ḅ됅됀脀ẁ0嬀4嬀4Ȁ荃ჰࠀ耀䀀Pऀ ソソソソソソ䝿쑒㈀
P
⌀ကԀ砀砀ꀀ Looping Mechanism: You can provide a way for the user to perform multiple calculations
without restarting the program by using loops (e.g., while or do-while loops) to repeatedly ask for
input until the user decides to exit.
5桷.Q萏֠葞֠࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀĀĀȀĀ儀ࠀༀ炄师炄㔈 ࠶㜀⨾䈀Ī䩃⩈伀J倀J
儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏ୀ葞ୀ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ̀ĀЀĀ儀ࠀༀႄ帎ႄ㔎 ࠶㜀⨾䈀Ī䩃⩈
伀J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏რ葞რ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀԀĀĀ儀ࠀༀ낄帓낄㔓 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏 葞 ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ܀ĀȀĀ儀ࠀༀ傄帙傄㔙 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷⚡㗐早㖺✺å儌q則Ä䃿ᐂ猀5倀@ǿ܀唀渀欀渀漀眀渀ǿࠀǿǿÿȀÿÿȀÿ䜀逞ȀԃԄ̂$
.寠xী吀椀洀攀猀 一攀眀 刀漀洀愀渀㔀逞ȁԀąĂ؇Ԃ匀礀洀戀漀氀㌀逮Ȁ؋ȄȂȂ$.寠xী䄀爀椀愀氀㜀逮ȀԏȂЂȃ$
.篤$ূ䌀愀氀椀戀爀椀䌀ⰮȀ̏ȂЂȃ$.篤$ূ䌀愀氀椀戀爀椀 䰀椀最栀琀䄀逞ȀԄԃȃ$¢$B鼀䌀愀洀戀爀椀愀 䴀愀琀栀
∀Ѐ耈탰栀耀쮅胇쮅ÇĀȀ퐀 ꄀ,ကᨀЀ̀徐ᤀ尀/ကᨀ攀ĀჰĀ需ḅ됅됀脀ẁ0嬀4嬀4Ȁ荃ჰࠀ耀䀀Pऀ ソソソソソソ䝿쑒㈀
P
⌀ကԀ砀砀ꀀ Modularity and Reusability: It is a good practice to organize the code into separate methods
or classes for each operation to make the program more modular and reusable. For instance, you can
create a method for each arithmetic operation.
// PAGE \* MERGEFORMAT 1 | P a g e
/Trinity Polytechnic Pune
/
6桷.Q萏֠葞֠࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀĀĀȀĀ儀ࠀༀ炄师炄㔈 ࠶㜀⨾䈀Ī䩃⩈伀J倀J
儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏ୀ葞ୀ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ̀ĀЀĀ儀ࠀༀႄ帎ႄ㔎 ࠶㜀⨾䈀Ī䩃⩈
伀J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏რ葞რ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀԀĀĀ儀ࠀༀ낄帓낄㔓 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷Q萏 葞 ࠵㘀 ࠷㸀*⩂䌁ᙊ䠀*䩏䩐䩑⩓帀J愀ᙊ瀀h焀쩲ÿ眀hĀ܀ĀȀĀ儀ࠀༀ傄帙傄㔙 ࠶㜀⨾䈀Ī䩃⩈伀
J倀J儀J匀*䩞䩡桰쩱
ÿÿ爀࣊桷⚡㗐早㖺✺å儌q則Ä䃿ᐂ猀5倀@ǿ܀唀渀欀渀漀眀渀ǿࠀǿǿÿȀÿÿȀÿ䜀逞ȀԃԄ̂$
.寠xী吀椀洀攀猀 一攀眀 刀漀洀愀渀㔀逞ȁԀąĂ؇Ԃ匀礀洀戀漀氀㌀逮Ȁ؋ȄȂȂ$.寠xী䄀爀椀愀氀㜀逮ȀԏȂЂȃ$
.篤$ূ䌀愀氀椀戀爀椀䌀ⰮȀ̏ȂЂȃ$.篤$ূ䌀愀氀椀戀爀椀 䰀椀最栀琀䄀逞ȀԄԃȃ$¢$B鼀䌀愀洀戀爀椀愀 䴀愀琀栀
∀Ѐ耈탰栀耀쮅胇쮅ÇĀȀ퐀 ꄀ,ကᨀЀ̀徐ᤀ尀/ကᨀ攀ĀჰĀ需ḅ됅됀脀ẁ0嬀4嬀4Ȁ荃ჰࠀ耀䀀Pऀ ソソソソソソ䝿쑒㈀
P
⌀ကԀ砀砀ꀀ User Interface: While the calculator can be built using a simple text-based interface in the
console, advanced calculators can be developed with graphical user interfaces (GUIs) using libraries
like Swing or JavaFX.
// PAGE \* MERGEFORMAT 1 | P a g e