0% found this document useful (0 votes)
2 views17 pages

A JP Report Half

The document outlines the vision and mission of the Computer Engineering Department at Government Polytechnic Thane, emphasizing the development of competent technical manpower. It details a micro-project on creating a Scientific Calculator using Java, including objectives, procedures, resources, and skills developed. The project aims to automate calculations and enhance productivity through a user-friendly interface with various mathematical functions.

Uploaded by

sejaldeshmukh93
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views17 pages

A JP Report Half

The document outlines the vision and mission of the Computer Engineering Department at Government Polytechnic Thane, emphasizing the development of competent technical manpower. It details a micro-project on creating a Scientific Calculator using Java, including objectives, procedures, resources, and skills developed. The project aims to automate calculations and enhance productivity through a user-friendly interface with various mathematical functions.

Uploaded by

sejaldeshmukh93
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Government Polytechnic Thane

Vision
To create competent technical manpower to cater industrial and societal needs.
Computer Engineering Department

Vision
To be a trend setting department in technical education providing highly
competent, efficient manpower to meet the ever technology.

Mission
We are committed to –
• To provide an atmosphere for students and faculty to enhance problem
solving skills, leadership qualities, team spirit & ethical responsibilities.
• To develop technical & professional skills to face Evolving Challenges
and Social Needs through Innovative Learning Process.
• Establish Industry institute interaction program to enhance
entrepreneurship skills.
• Enabling the Students to Excel in their Professions and Careers with
lifelong learning keeping speedy growth with emerging technology.

Program Educational Objectives (PEOs)


PEO1: Adopt state-of-the-art Computer engineering broad-based technologies to
work in multi-disciplinary work environments.
PEO2: Solve broad-based problems individually and as a team member
communicating effectively in the world of work.
Assessment Report of Micro-Project
Advanced Java Programming

CO5I

MAHARASHTRA STATE BOARD


OF TECHNICAL EDUCATION, MUMBAI
Academic Year: 2022-2023
Department: Computer Engineering
Semester: CO5I
Course: Advanced Java Programming
Course Code: (22517)

Micro-Project Group Members:


Roll Number Name Enrollment Number
29 Samruddhi Chafekar 2001160192
40 Sangharaj Jadhav 2001160204
49 Aditya Patil 2001160213
68 Sejal Deshmukh 2001160232
PART B – PLAN

Micro-Project Report

Title of Micro-Project: Scientific Calculator

1.0: Brief Introduction:

- A scientific calculator is a type of electronic calculator, usually but not always handheld,
designed to calculate problems in science (especially physics),engineering, and
mathematics. They have almost completely replaced slide rules in almost all traditional
applications, and are widely used in both education and professional settings.
- The project Scientific Calculator is designed to automate the calculation procedure. Making
less paper work and automate the process of calculation.
- scientific notation
- exponential functions and roots beyond the square root
- quick access to constants such as pi and e

2.0: Aim of Micro-Project:

- In this day and age, Scientific Calculator has become a large part of everybody’s
work and school life. You can make yourself more productive by learning how to
improve your Calculations.
- In this project we have added basic math functions such as addition, subtraction,
Multiplication and division. Some scientific functions such sin, cos, tan and
added logarithm and exponential functions.
- In certain contexts such as higher education, scientific calculators have been
superseded by graphing calculators, which offer a superset of scientific calculator
functionality along with the ability to graph input data and write and store
programs for the device.
- There is also some overlap with the financial calculator market.
- The project Scientific Calculator is designed to automate the calculation procedure.
- Making less paper work and automate the process of calculation.
3.0: Course Outcome Integrated:

- Develop programs using GUI framework (AWT and Swing) - Handle events of
AWT and Swing components.
- Develop programs to handle events in Java Programming.

4.0: Actual Procedure Followed:

To start Designing our project’s code, we first gathered the information about our
project’s topic and analysed what assets will be needed. After gathering we designed
different functions and core logic for the game. Post design completion members were
distributed with tasks – Assets creating, Code units were assigned to each member to
implement it in the program. Later Assets were used to change to look and feel of the
game and units were integrated together for testing and debugging. After a lot of
debugging the game was ready to be documented. Then we prepared presentation and
report for our microproject.

5.0: Actual Resources Used:

Name of
Sr. Resource/ Specifications
Quantity Remark
No.
Material
1 Intel Core 8th Gen i5 Processor, 1
PC/Laptop 4GB RAM, 1TB HDD

Operating
2 System Windows 11 1

3 2
Website • www.forgetcode.com
• www.wikipedia.org
4 1
Reference “Java the Complete Reference” Author:
book Herbert Schildt.
5 • Java Development Kit 2
Software Version “1.8.0_331”
• IntelliJ IDEA

6.0: Skills Developed:

- Understand the Swing package including swing events.


- Know how to manipulate components to be fitted in different layout managers.
- Learn to customize Look and Feel of swing to suit the program.

7.0: Applications:

- Desktop Applications.
- To handle exponential operations, square roots, logarithms, trigonometric
functions.
- Allows the user to solve more difficult equations greater than one or two terms
quickly and easily

8.0: Source Code & Output:

package com.company;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
class ScientificCalculator extends JFrame implements ActionListener {
JTextField tfield;
double temp, temp1, result, a;
static double m1, m2;
int k = 1, x = 0, y = 0, z = 0;
char ch;
JButton b1, b2, b3, b4, b5, b6, b7, b8, b9, zero, clr, pow2, pow3, exp,
fac, plus, min, div, log, rec, mul, eq, addSub, dot, mr, mc, mp,
mm, sqrt, sin, cos, tan;
Container cont;
JPanel textPanel, buttonpanel;
ScientificCalculator() {
cont = getContentPane();
cont.setLayout(new BorderLayout());
JPanel textpanel = new JPanel();
tfield = new JTextField(50);
tfield.setHorizontalAlignment(SwingConstants.RIGHT);
tfield.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent keyevent) {
char c = keyevent.getKeyChar();
if (c >= '0' && c <= '9') {
} else {
keyevent.consume();
}
}
});
textpanel.add(tfield);
buttonpanel = new JPanel();
buttonpanel.setLayout(new GridLayout(8, 4, 1, 1));
boolean t = true;

mr = new JButton("MR");
buttonpanel.add(mr);
mr.addActionListener(this);
mc = new JButton("MC");

buttonpanel.add(mc);
mc.addActionListener(this);
mp = new JButton("M+");
buttonpanel.add(mp);
mp.addActionListener(this);
mm = new JButton("M-");
buttonpanel.add(mm);
mm.addActionListener(this);

b1 = new JButton("1");
buttonpanel.add(b1);
b1.addActionListener(this);

b2 = new JButton("2");
buttonpanel.add(b2);
b2.addActionListener(this);

b3 = new JButton("3");
buttonpanel.add(b3);
b3.addActionListener(this);

plus = new JButton("+");


buttonpanel.add(plus);
plus.addActionListener(this);

b4 = new JButton("4");
buttonpanel.add(b4);
b4.addActionListener(this);

b5 = new JButton("5");
buttonpanel.add(b5);
b5.addActionListener(this);
b5.setBounds(40,40,100,100);
b6 = new JButton("6");
buttonpanel.add(b6);
b6.addActionListener(this);

min = new JButton("-");


buttonpanel.add(min);
min.addActionListener(this);

b7 = new JButton("7");
buttonpanel.add(b7);
b7.addActionListener(this);

b8 = new JButton("8");
buttonpanel.add(b8);
b8.addActionListener(this);

b9 = new JButton("9");
buttonpanel.add(b9);
b9.addActionListener(this);

mul = new JButton("*");


buttonpanel.add(mul);
mul.addActionListener(this);

dot = new JButton(".");


buttonpanel.add(dot);
dot.addActionListener(this);

zero = new JButton("0");


zero.addActionListener(this);
buttonpanel.add(zero);

addSub = new JButton("+/-");


buttonpanel.add(addSub);
addSub.addActionListener(this);
// buttonpanel.setBackground(Color.BLACK);

div = new JButton("/");


buttonpanel.add(div);
div.addActionListener(this);
eq = new JButton("=");
buttonpanel.add(eq);
eq.addActionListener(this);
rec = new JButton("1/x");
buttonpanel.add(rec);
rec.addActionListener(this);
sqrt = new JButton("Sqrt");
buttonpanel.add(sqrt);
sqrt.addActionListener(this);
log = new JButton("log");
buttonpanel.add(log);
log.addActionListener(this);
sin = new JButton("SIN");
buttonpanel.add(sin);
sin.addActionListener(this);
cos = new JButton("COS");
buttonpanel.add(cos);
cos.addActionListener(this);
tan = new JButton("TAN");
buttonpanel.add(tan);
tan.addActionListener(this);
pow2 = new JButton("x^2");
buttonpanel.add(pow2);
pow2.addActionListener(this);
pow3 = new JButton("x^3");
buttonpanel.add(pow3);
pow3.addActionListener(this);
exp = new JButton("Exp");
exp.addActionListener(this);
buttonpanel.add(exp);
fac = new JButton("n!");
fac.addActionListener(this);
buttonpanel.add(fac);
clr = new JButton("AC");
buttonpanel.add(clr);
clr.addActionListener(this);

cont.add("Center", buttonpanel);
cont.add("North", textpanel);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void actionPerformed(ActionEvent e) {
String s = e.getActionCommand();
if (s.equals("1")) {
if (z == 0) {
tfield.setText(tfield.getText() + "1");
} else {
tfield.setText("");
tfield.setText(tfield.getText() + "1");
z = 0;
}
}
if (s.equals("2")) {
if (z == 0) {
tfield.setText(tfield.getText() + "2");
} else {
tfield.setText("");
tfield.setText(tfield.getText() + "2");
z = 0;
}
}
if (s.equals("3")) {
if (z == 0) {
tfield.setText(tfield.getText() + "3");
} else {
tfield.setText("");
tfield.setText(tfield.getText() + "3");
z = 0;
}
}
if (s.equals("4")) {
if (z == 0) {
tfield.setText(tfield.getText() + "4");
} else {
tfield.setText("");
tfield.setText(tfield.getText() + "4");
z = 0;
}
}
if (s.equals("5")) {
if (z == 0) {
tfield.setText(tfield.getText() + "5");
} else {
tfield.setText("");
tfield.setText(tfield.getText() + "5");
z = 0;
}
}
if (s.equals("6")) {
if (z == 0) {
tfield.setText(tfield.getText() + "6");
} else {
tfield.setText("");
tfield.setText(tfield.getText() + "6");
z = 0;
}
}
if (s.equals("7")) {
if (z == 0) {
tfield.setText(tfield.getText() + "7");
} else {
tfield.setText("");
tfield.setText(tfield.getText() + "7");
z = 0;
}
}
if (s.equals("8")) {
if (z == 0) {
tfield.setText(tfield.getText() + "8");
} else {
tfield.setText("");
tfield.setText(tfield.getText() + "8");
z = 0;
}
}
if (s.equals("9")) {
if (z == 0) {
tfield.setText(tfield.getText() + "9");
} else {
tfield.setText("");
tfield.setText(tfield.getText() + "9");
z = 0;
}
}
if (s.equals("0")) {
if (z == 0) {
tfield.setText(tfield.getText() + "0");
} else {
tfield.setText("");
tfield.setText(tfield.getText() + "0");
z = 0;
}
}
if (s.equals("AC")) {
tfield.setText("");
x = 0;
y = 0;
z = 0;
}
if (s.equals("log")) {
if (tfield.getText().equals("")) {
tfield.setText("");
} else {
a = Math.log(Double.parseDouble(tfield.getText()));
tfield.setText("");
tfield.setText(tfield.getText() + a);
}
}
if (s.equals("1/x")) {
if (tfield.getText().equals("")) {
tfield.setText("");
} else {
a = 1 / Double.parseDouble(tfield.getText());
tfield.setText("");
tfield.setText(tfield.getText() + a);
}
}
if (s.equals("Exp")) {
if (tfield.getText().equals("")) {
tfield.setText("");
} else {
a = Math.exp(Double.parseDouble(tfield.getText()));
tfield.setText("");
tfield.setText(tfield.getText() + a);
}
}
if (s.equals("x^2")) {
if (tfield.getText().equals("")) {
tfield.setText("");
} else {
a = Math.pow(Double.parseDouble(tfield.getText()), 2);
tfield.setText("");
tfield.setText(tfield.getText() + a);
}
}
if (s.equals("x^3")) {
if (tfield.getText().equals("")) {
tfield.setText("");
} else {
a = Math.pow(Double.parseDouble(tfield.getText()), 3);
tfield.setText("");
tfield.setText(tfield.getText() + a);
}
}
if (s.equals("+/-")) {
if (x == 0) {
tfield.setText("-" + tfield.getText());
x = 1;
} else {
tfield.setText(tfield.getText());
}
}
if (s.equals(".")) {
if (y == 0) {
tfield.setText(tfield.getText() + ".");
y = 1;
} else {
tfield.setText(tfield.getText());
}
}
if (s.equals("+")) {
if (tfield.getText().equals("")) {
tfield.setText("");
temp = 0;
ch = '+';
} else {
temp = Double.parseDouble(tfield.getText());
tfield.setText("");
ch = '+';
y = 0;
x = 0;
}
tfield.requestFocus();
}
if (s.equals("-")) {
if (tfield.getText().equals("")) {
tfield.setText("");
temp = 0;
ch = '-';
} else {
x = 0;
y = 0;
temp = Double.parseDouble(tfield.getText());
tfield.setText("");
ch = '-';
}
tfield.requestFocus();
}
if (s.equals("/")) {
if (tfield.getText().equals("")) {
tfield.setText("");
temp = 1;
ch = '/';
} else {
x = 0;
y = 0;
temp = Double.parseDouble(tfield.getText());
ch = '/';
tfield.setText("");
}
tfield.requestFocus();
}
if (s.equals("*")) {
if (tfield.getText().equals("")) {
tfield.setText("");
temp = 1;
ch = '*';
} else {
x = 0;
y = 0;
temp = Double.parseDouble(tfield.getText());
ch = '*';
tfield.setText("");
}
tfield.requestFocus();
}
if (s.equals("MC")) {
m1 = 0;
tfield.setText("");
}
if (s.equals("MR")) {
tfield.setText("");
tfield.setText(tfield.getText() + m1);
}
if (s.equals("M+")) {
if (k == 1) {
m1 = Double.parseDouble(tfield.getText());
k++;
} else {
m1 += Double.parseDouble(tfield.getText());
tfield.setText("" + m1);
}
}
if (s.equals("M-")) {
if (k == 1) {
m1 = Double.parseDouble(tfield.getText());
k++;
} else {
m1 -= Double.parseDouble(tfield.getText());
tfield.setText("" + m1);
}
}
if (s.equals("Sqrt")) {
if (tfield.getText().equals("")) {
tfield.setText("");
} else {
a = Math.sqrt(Double.parseDouble(tfield.getText()));
tfield.setText("");
tfield.setText(tfield.getText() + a);
}
}
if (s.equals("SIN")) {
if (tfield.getText().equals("")) {
tfield.setText("");
} else {
a = Math.sin(Double.parseDouble(tfield.getText()));
tfield.setText("");
tfield.setText(tfield.getText() + a);
}
}
if (s.equals("COS")) {
if (tfield.getText().equals("")) {
tfield.setText("");
} else {
a = Math.cos(Double.parseDouble(tfield.getText()));
tfield.setText("");
tfield.setText(tfield.getText() + a);
}
}
if (s.equals("TAN")) {
if (tfield.getText().equals("")) {
tfield.setText("");
} else {
a = Math.tan(Double.parseDouble(tfield.getText()));
tfield.setText("");
tfield.setText(tfield.getText() + a);
}
}
if (s.equals("=")) {
if (tfield.getText().equals("")) {
tfield.setText("");
} else {
temp1 = Double.parseDouble(tfield.getText());
switch (ch) {
case '+':
result = temp + temp1;
break;
case '-':
result = temp - temp1;
break;
case '/':
result = temp / temp1;
break;
case '*':
result = temp * temp1;
break;
}
tfield.setText("");
tfield.setText(tfield.getText() + result);
z = 1;
}
}
if (s.equals("n!")) {
if (tfield.getText().equals("")) {
tfield.setText("");
} else {
a = fact(Double.parseDouble(tfield.getText()));
tfield.setText("");
tfield.setText(tfield.getText() + a);
}
}
tfield.requestFocus();
}
double fact(double x) {
int er = 0;
if (x < 0) {
er = 20;
return 0;
}
double i, s = 1;
for (i = 2; i <= x; i += 1.0)
s *= i;
return s;
}
public static void main(String args[]) {
try {
UIManager
.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFe
el");
} catch (Exception e) {
}
ScientificCalculator f = new ScientificCalculator();
f.setTitle("ScientificCalculator");
f.pack();
f.setVisible(true);
}
}

You might also like