SlideShare a Scribd company logo
1 of 22
 Simple Interest
Coding:-
private voidokActionPerformed(java.awt.event.ActionEventevt) {
inta,b,c,d;
a=Integer.parseInt(Prince.getText());
b=Integer.parseInt(Rate.getText());
c=Integer.parseInt(Time.getText());
d=(a*b*c)/100;
Result.setText(""+d);
}
private voidclearActionPerformed(java.awt.event.ActionEventevt) {
Prince.setText("");
Rate.setText("");
Time.setText("");
Result.setText("");
}
private voidexitActionPerformed(java.awt.event.ActionEventevt) {
System.exit(0);
}
 Marksheet
Coding:
private voidclrActionPerformed(java.awt.event.ActionEventevt) {
a.setText("");
b.setText("");
c.setText("");
d.setText("");
e.setText("");
f.setText("");
}
private void remarkActionPerformed(java.awt.event.ActionEventevt) {
intA,B,C,D,E,F;
A=Integer.parseInt(a.getText());
B=Integer.parseInt(b.getText());
C=Integer.parseInt(c.getText());
D=Integer.parseInt(d.getText());
E=Integer.parseInt(e.getText());
if(A>35&& B>35 && C>35 && D>35 && E>35)
{
f.setText("Pass");
}
else
{
f.setText("Fail");
}
}
private void exitActionPerformed(java.awt.event.ActionEventevt) {
System.exit(0);
}
 Quadratic Equation
Coding:
private voidvaluesActionPerformed(java.awt.event.ActionEventevt) {
double A,B,C,D,E;
A=Integer.parseInt(a.getText());
B=Integer.parseInt(b.getText());
C=Integer.parseInt(c.getText());
double F=Math.pow(B*B-(4*A*C),0.5);
D=(-B+F)/(2*A);
d.setText(""+D);
E=(-B-F)/(2*A);
e.setText(""+E);
}
private void clrActionPerformed(java.awt.event.ActionEventevt){
a.setText("");
b.setText("");
c.setText("");
d.setText("");
e.setText("");
}
private void exitActionPerformed(java.awt.event.ActionEventevt) {
System.exit(0); }
 For loop, Do….While Loop and While
Loop
Coding:
private voidcontinueActionPerformed(java.awt.event.ActionEventevt) {
int t;
t=Integer.parseInt(P.getText());
A.append("Numbersare ...... n");
for(inti=1;i<=t; i++)
{ A.append(""+i + "n"); }
int n=1;
do{
B.append("");
B.append(""+n+"n");
n++;
} while(n<=t);
intu=1;
while(u<=t){
C.append("");
C.append(""+u+"n");
u++;
}
}
 FIBONACCISERIES
Coding:
private voidokActionPerformed(java.awt.event.ActionEventevt){
intt;
t=Integer.parseInt(a.getText());
intf1, f2=0, f3=1 ,f4 = 0;
b.setText("");
for(inti=0;i<t;i++)
{ if(i==0)
{ b.append("0"+"n"); }
else
{ f1=f2+f3;
f3=f2;
f2=f1;
f4=f4+f1;
b.append(""+f1+"n");
} }
JOptionPane.showMessageDialog(null,"Sum="+f4);
}
private void clrActionPerformed(java.awt.event.ActionEventevt) {
a.setText("");
b.setText(""); }
 CombinationFormula
Coding:
private voidcombinationActionPerformed(java.awt.event.ActionEventevt) {
intn,m;
n=Integer.parseInt(A.getText());
m=Integer.parseInt(B.getText());
inti,j=1;
for(i=1;i<=n;i++)
{ j=j*i; }
ints,t=1;
for(s=1;s<=m;s++)
{ t=t*s; }
intp; p=n-m;
intk,l=1;
for(k=1;k<=p;k++)
{ l=l*k; }
intres;
res=j/(t*l);
c.setText(""+res);
}
private void clearActionPerformed(java.awt.event.ActionEventevt) {
A.setText(""); B.setText("");
c.setText(""); }
 SUM OF TWONUMBERS USING
INPUTMETHOD
Coding:
private voidclickmeActionPerformed(java.awt.event.ActionEventevt) {
int a, b,c,d;
Strings,t;
s=JOptionPane.showInputDialog("EnterfirstNumber");
t=JOptionPane.showInputDialog("EntersecondNumber");
a=Integer.parseInt(s);
b=Integer.parseInt(t);
c=a+b;
JOptionPane.showMessageDialog(null,"The sumof twonumberis:" +c);
}
 HighestNumberUsingConditional
Operator
Coding:
private voidclearActionPerformed(java.awt.event.ActionEventevt) {
A.setText("");
B.setText("");
C.setText("");
}
private void okActionPerformed(java.awt.event.ActionEventevt) {
int a, b;
a= Integer.parseInt(A.getText());
b= Integer.parseInt(B.getText());
intc;
c= a>b?a:b;
C.setText("The highestnumberis:" +c);
}
private void exitActionPerformed(java.awt.event.ActionEventevt) {
System.exit(0); }
 Factorial
Coding:
private voidokActionPerformed(java.awt.event.ActionEventevt) {
double n;
n= Double.parseDouble(A.getText());
double i,j=1;
for(i=1;i<=n;i++)
{
j*=i;
}
B.setText(Double.toString(j));
}
private void clearActionPerformed(java.awt.event.ActionEventevt) {
A.setText("");
B.setText("");
}
 PrimeNumber
CODING:
private voidexitActionPerformed(java.awt.event.ActionEventevt) {
System.exit(0); }
private void clearActionPerformed(java.awt.event.ActionEventevt) {
a.setText("");
b.setText("");
}
private void primenoActionPerformed(java.awt.event.ActionEventevt) {
int A,i;
A=Integer.parseInt(a.getText());
for(i=2;i<=A/2;i++)
{
if(A%i==0)
{
break;
}
}
if(i>A/2)
{
b.setText("Itisprime number");
}
else
{
b.setText("Itisnotprime number");
}
 The Given Number Is Magic Number
Or Not
CODING:
private voidokActionPerformed(java.awt.event.ActionEventevt) {
inta = 0,b=1,c=0,d;
a=Integer.parseInt(A.getText());
d=a;
inti=a;
while(d>0)
{ b *= d%10; d/=10;
c += i%10; i/=10;
}
B.setText("Sumof digit"+a+ " is: " + c);
C.setText("Productof digit"+a+ " is : " + b);
inte;
e=b+c;
D.setText(""+e);
if(a==e)
JOptionPane.showMessageDialog(null,"ThegivennumberisMagicNumber");
else
JOptionPane.showMessageDialog(null,"Thegivennumberis notMagic Number");
}
 ShortName
CODING:
private voidokActionPerformed(java.awt.event.ActionEventevt) {
Stringf , m , l , s=" ";
f = a.getText().substring(0,1);
m =b.getText().substring(0,1);
l= c.getText();
s = s.concat(f);
s=s.concat(". ");
s= s.concat(m);
s=s.concat(". ");
s=s.concat(l);
s = s.concat(" ");
d.setText(s);
}

More Related Content

What's hot

EJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOSEJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOS
Darwin Durand
 
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートIIopenFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
Atsushi Tadokoro
 
Vatesh
VateshVatesh
Vatesh
vatesh
 
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートIIopenFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
Atsushi Tadokoro
 

What's hot (20)

Hace una calculadora en jeank
Hace una calculadora en jeankHace una calculadora en jeank
Hace una calculadora en jeank
 
Антон Полухин. C++17
Антон Полухин. C++17Антон Полухин. C++17
Антон Полухин. C++17
 
Dasar c
Dasar cDasar c
Dasar c
 
Aplicacion turbogenerador java
Aplicacion turbogenerador javaAplicacion turbogenerador java
Aplicacion turbogenerador java
 
Gaztea Tech 2015: 4. GT Drawbot Control
Gaztea Tech 2015: 4. GT Drawbot ControlGaztea Tech 2015: 4. GT Drawbot Control
Gaztea Tech 2015: 4. GT Drawbot Control
 
Фатальный недостаток Node.js
Фатальный недостаток Node.jsФатальный недостаток Node.js
Фатальный недостаток Node.js
 
EJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOSEJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOS
 
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートIIopenFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
 
Vatesh
VateshVatesh
Vatesh
 
Dwr实战
Dwr实战Dwr实战
Dwr实战
 
Macro
MacroMacro
Macro
 
Sis quiz
Sis quizSis quiz
Sis quiz
 
Juego del gato
Juego del gatoJuego del gato
Juego del gato
 
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートIIopenFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
 
Taller1
Taller1Taller1
Taller1
 
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
 
C++14 reflections
C++14 reflections C++14 reflections
C++14 reflections
 
Most Common JavaScript Mistakes
Most Common JavaScript MistakesMost Common JavaScript Mistakes
Most Common JavaScript Mistakes
 
Programs
ProgramsPrograms
Programs
 
Programs
ProgramsPrograms
Programs
 

More from HimanshiSingh71

More from HimanshiSingh71 (13)

RFID Technology - Electronics and Communication Seminar Topic
RFID Technology - Electronics and Communication Seminar TopicRFID Technology - Electronics and Communication Seminar Topic
RFID Technology - Electronics and Communication Seminar Topic
 
Automatic Car Number Plate Detection and Recognition using MATLAB
Automatic Car Number Plate Detection and Recognition using MATLABAutomatic Car Number Plate Detection and Recognition using MATLAB
Automatic Car Number Plate Detection and Recognition using MATLAB
 
Object Oriented Programming in Java
Object Oriented Programming in JavaObject Oriented Programming in Java
Object Oriented Programming in Java
 
Global Earthquake Monitor (Real Time)
Global Earthquake Monitor (Real Time)Global Earthquake Monitor (Real Time)
Global Earthquake Monitor (Real Time)
 
E1 LINK IS EUROPEAN FORMAT
E1 LINK IS EUROPEAN FORMAT E1 LINK IS EUROPEAN FORMAT
E1 LINK IS EUROPEAN FORMAT
 
Training Report BHARAT ELECTRONICS LIMITED
Training Report BHARAT ELECTRONICS LIMITEDTraining Report BHARAT ELECTRONICS LIMITED
Training Report BHARAT ELECTRONICS LIMITED
 
Java Based Case Study program Solved Question
Java Based Case Study program Solved QuestionJava Based Case Study program Solved Question
Java Based Case Study program Solved Question
 
One table MySQL queries
One table MySQL queriesOne table MySQL queries
One table MySQL queries
 
Mysql two table queries
Mysql two table queriesMysql two table queries
Mysql two table queries
 
JDBC (JAVA Database Connectivity)
JDBC (JAVA Database Connectivity)JDBC (JAVA Database Connectivity)
JDBC (JAVA Database Connectivity)
 
Child Labour in India
Child Labour in India Child Labour in India
Child Labour in India
 
Airline reservation project using JAVA in NetBeans IDE
Airline reservation project using JAVA in NetBeans IDEAirline reservation project using JAVA in NetBeans IDE
Airline reservation project using JAVA in NetBeans IDE
 
Automatic street light using LDR and Transistor
Automatic street light using LDR  and TransistorAutomatic street light using LDR  and Transistor
Automatic street light using LDR and Transistor
 

JAVA Program in NetBeans