SlideShare a Scribd company logo
JAVA Program in NetBeans
 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 (20)

Hace una calculadora en jeank
Hace una calculadora en jeankHace una calculadora en jeank
Hace una calculadora en jeank
HumbertoWuwu
 
Антон Полухин. C++17
Антон Полухин. C++17Антон Полухин. C++17
Антон Полухин. C++17
Sergey Platonov
 
Aplicacion turbogenerador java
Aplicacion turbogenerador javaAplicacion turbogenerador java
Aplicacion turbogenerador java
José Antonio Sandoval Acosta
 
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
Svet Ivantchev
 
Фатальный недостаток Node.js
Фатальный недостаток Node.jsФатальный недостаток Node.js
Фатальный недостаток Node.js
Oleksii Okhrymenko
 
EJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOSEJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOS
Darwin Durand
 
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートIIopenFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
Atsushi Tadokoro
 
Vatesh
VateshVatesh
Vatesh
vatesh
 
Sis quiz
Sis quizSis quiz
Sis quiz
Clesio Veloso
 
Juego del gato
Juego del gatoJuego del gato
Juego del gato
julian javier solis herrera
 
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートIIopenFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
Atsushi Tadokoro
 
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
SPECIA
 
C++14 reflections
C++14 reflections C++14 reflections
C++14 reflections
corehard_by
 
Most Common JavaScript Mistakes
Most Common JavaScript MistakesMost Common JavaScript Mistakes
Most Common JavaScript Mistakes
Yoann Gotthilf
 
Programs
ProgramsPrograms
Programs
Murali Kummitha
 
Hace una calculadora en jeank
Hace una calculadora en jeankHace una calculadora en jeank
Hace una calculadora en jeank
HumbertoWuwu
 
Антон Полухин. C++17
Антон Полухин. C++17Антон Полухин. C++17
Антон Полухин. C++17
Sergey Platonov
 
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
Svet Ivantchev
 
Фатальный недостаток Node.js
Фатальный недостаток Node.jsФатальный недостаток Node.js
Фатальный недостаток Node.js
Oleksii Okhrymenko
 
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
 
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
SPECIA
 
C++14 reflections
C++14 reflections C++14 reflections
C++14 reflections
corehard_by
 
Most Common JavaScript Mistakes
Most Common JavaScript MistakesMost Common JavaScript Mistakes
Most Common JavaScript Mistakes
Yoann Gotthilf
 

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
HimanshiSingh71
 
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
HimanshiSingh71
 
Object Oriented Programming in Java
Object Oriented Programming in JavaObject Oriented Programming in Java
Object Oriented Programming in Java
HimanshiSingh71
 
Global Earthquake Monitor (Real Time)
Global Earthquake Monitor (Real Time)Global Earthquake Monitor (Real Time)
Global Earthquake Monitor (Real Time)
HimanshiSingh71
 
E1 LINK IS EUROPEAN FORMAT
E1 LINK IS EUROPEAN FORMAT E1 LINK IS EUROPEAN FORMAT
E1 LINK IS EUROPEAN FORMAT
HimanshiSingh71
 
Training Report BHARAT ELECTRONICS LIMITED
Training Report BHARAT ELECTRONICS LIMITEDTraining Report BHARAT ELECTRONICS LIMITED
Training Report BHARAT ELECTRONICS LIMITED
HimanshiSingh71
 
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
HimanshiSingh71
 
One table MySQL queries
One table MySQL queriesOne table MySQL queries
One table MySQL queries
HimanshiSingh71
 
Mysql two table queries
Mysql two table queriesMysql two table queries
Mysql two table queries
HimanshiSingh71
 
JDBC (JAVA Database Connectivity)
JDBC (JAVA Database Connectivity)JDBC (JAVA Database Connectivity)
JDBC (JAVA Database Connectivity)
HimanshiSingh71
 
Child Labour in India
Child Labour in India Child Labour in India
Child Labour in India
HimanshiSingh71
 
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
HimanshiSingh71
 
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
HimanshiSingh71
 
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
HimanshiSingh71
 
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
HimanshiSingh71
 
Object Oriented Programming in Java
Object Oriented Programming in JavaObject Oriented Programming in Java
Object Oriented Programming in Java
HimanshiSingh71
 
Global Earthquake Monitor (Real Time)
Global Earthquake Monitor (Real Time)Global Earthquake Monitor (Real Time)
Global Earthquake Monitor (Real Time)
HimanshiSingh71
 
E1 LINK IS EUROPEAN FORMAT
E1 LINK IS EUROPEAN FORMAT E1 LINK IS EUROPEAN FORMAT
E1 LINK IS EUROPEAN FORMAT
HimanshiSingh71
 
Training Report BHARAT ELECTRONICS LIMITED
Training Report BHARAT ELECTRONICS LIMITEDTraining Report BHARAT ELECTRONICS LIMITED
Training Report BHARAT ELECTRONICS LIMITED
HimanshiSingh71
 
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
HimanshiSingh71
 
JDBC (JAVA Database Connectivity)
JDBC (JAVA Database Connectivity)JDBC (JAVA Database Connectivity)
JDBC (JAVA Database Connectivity)
HimanshiSingh71
 
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
HimanshiSingh71
 
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
HimanshiSingh71
 
Ad

Recently uploaded (8)

laminas para trabbajar la lectoescritura
laminas para trabbajar la lectoescrituralaminas para trabbajar la lectoescritura
laminas para trabbajar la lectoescritura
FernandaRiveraFlores4
 
наказ про зарахуваннядо 1 класу kg72 2025
наказ про зарахуваннядо 1 класу   kg72  2025наказ про зарахуваннядо 1 класу   kg72  2025
наказ про зарахуваннядо 1 класу kg72 2025
AleksSaf
 
map.11111111111111111111111111121111.pdf
map.11111111111111111111111111121111.pdfmap.11111111111111111111111111121111.pdf
map.11111111111111111111111111121111.pdf
s99808177
 
Reportàge on Kaliningrad LEMONDE.3PAG.pdf
Reportàge on Kaliningrad LEMONDE.3PAG.pdfReportàge on Kaliningrad LEMONDE.3PAG.pdf
Reportàge on Kaliningrad LEMONDE.3PAG.pdf
Stefano Lariccia
 
Presentación Diapositivas Cuerpo Humano Órganos Ilustrada Rosa Crema.pptx
Presentación Diapositivas Cuerpo Humano Órganos Ilustrada Rosa Crema.pptxPresentación Diapositivas Cuerpo Humano Órganos Ilustrada Rosa Crema.pptx
Presentación Diapositivas Cuerpo Humano Órganos Ilustrada Rosa Crema.pptx
JordanRada
 
History for the class 12 students and class 10
History for the class 12 students and class 10History for the class 12 students and class 10
History for the class 12 students and class 10
suseelasudarmani
 
Lime To My Coconut A Caribbean Island Spicy Romantic Comedy Lynn Joseph
Lime To My Coconut A Caribbean Island Spicy Romantic Comedy Lynn JosephLime To My Coconut A Caribbean Island Spicy Romantic Comedy Lynn Joseph
Lime To My Coconut A Caribbean Island Spicy Romantic Comedy Lynn Joseph
mmnlzzyag317
 
pdf-p-classtruncatedtext-module-lineclamped-85ulhh-style-max-lines5topik-tema...
pdf-p-classtruncatedtext-module-lineclamped-85ulhh-style-max-lines5topik-tema...pdf-p-classtruncatedtext-module-lineclamped-85ulhh-style-max-lines5topik-tema...
pdf-p-classtruncatedtext-module-lineclamped-85ulhh-style-max-lines5topik-tema...
Ifa Nofalia
 
laminas para trabbajar la lectoescritura
laminas para trabbajar la lectoescrituralaminas para trabbajar la lectoescritura
laminas para trabbajar la lectoescritura
FernandaRiveraFlores4
 
наказ про зарахуваннядо 1 класу kg72 2025
наказ про зарахуваннядо 1 класу   kg72  2025наказ про зарахуваннядо 1 класу   kg72  2025
наказ про зарахуваннядо 1 класу kg72 2025
AleksSaf
 
map.11111111111111111111111111121111.pdf
map.11111111111111111111111111121111.pdfmap.11111111111111111111111111121111.pdf
map.11111111111111111111111111121111.pdf
s99808177
 
Reportàge on Kaliningrad LEMONDE.3PAG.pdf
Reportàge on Kaliningrad LEMONDE.3PAG.pdfReportàge on Kaliningrad LEMONDE.3PAG.pdf
Reportàge on Kaliningrad LEMONDE.3PAG.pdf
Stefano Lariccia
 
Presentación Diapositivas Cuerpo Humano Órganos Ilustrada Rosa Crema.pptx
Presentación Diapositivas Cuerpo Humano Órganos Ilustrada Rosa Crema.pptxPresentación Diapositivas Cuerpo Humano Órganos Ilustrada Rosa Crema.pptx
Presentación Diapositivas Cuerpo Humano Órganos Ilustrada Rosa Crema.pptx
JordanRada
 
History for the class 12 students and class 10
History for the class 12 students and class 10History for the class 12 students and class 10
History for the class 12 students and class 10
suseelasudarmani
 
Lime To My Coconut A Caribbean Island Spicy Romantic Comedy Lynn Joseph
Lime To My Coconut A Caribbean Island Spicy Romantic Comedy Lynn JosephLime To My Coconut A Caribbean Island Spicy Romantic Comedy Lynn Joseph
Lime To My Coconut A Caribbean Island Spicy Romantic Comedy Lynn Joseph
mmnlzzyag317
 
pdf-p-classtruncatedtext-module-lineclamped-85ulhh-style-max-lines5topik-tema...
pdf-p-classtruncatedtext-module-lineclamped-85ulhh-style-max-lines5topik-tema...pdf-p-classtruncatedtext-module-lineclamped-85ulhh-style-max-lines5topik-tema...
pdf-p-classtruncatedtext-module-lineclamped-85ulhh-style-max-lines5topik-tema...
Ifa Nofalia
 
Ad

JAVA Program in NetBeans