1. GRADE CALCULATOR
DESIGN PAMPHLET
OUTPUT SCREEN
CODE FOR ABOVE RESULT
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
double a=Double.parseDouble(n1.getText());
if(a>=90)
n2.setText("A GRADE");
else if (a>=75 && a<90)
n2.setText("B GRADE");
else if(a>=40 && a<75)
n2.setText("C GRADE");
else if (a>=35 && a<40)
n2.setText("D GRADE");
else
n2.setText("FAIL");
2. FEES CRITERIA
DESIGN PAMPHLET
OUTPUT SCREEN
CODE FOR ABOVE RESULT
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String a=t1.getText();
int s;
if(r1.isSelected())
{s=500;
if(c1.isSelected())
s=0;}
else
s=1000;
t2.append("NAME:"+a+"\n");
t2.append("FEES:"+s);
3. INTEREST CALCULATOR
DESIGN PAMPHLET
OUTPUT SCREEN
CODE FOR ABOVE RESULT
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int a= Integer.parseInt(t1.getText());
int b= Integer.parseInt(t2.getText());
int c= Integer.parseInt(t3.getText());
if(r1.isSelected())
{if(b<=1)
c=10;
else if(b>1 && b<=5)
c=12;
else
c=15;}
else{
if(b<=2)
c=11;
else if(b>2 && b<=7)
c=12;
else
c=15;}
float s;
s=((1+c/100)*b)*a;
float d= a+s;
t4.setText(""+s);
t5.setText(""+d);}
DESIGN PAMPHLET
OUTPUT SCREEN
CODE FOR ABOVE RESULT
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
float a= Float.parseFloat(t1.getText());
float b= Float.parseFloat(t2.getText());
float c= Float.parseFloat(t3.getText());
float d= Float.parseFloat(t4.getText());
float e= Float.parseFloat(t5.getText());
float f= a+b+c+d+e;
t6.setText("YOUR MARKS OUT OF 500 ARE:"+f);
float y= f*100/500;
t7.setText("YOUR PERCENTAGE IS:"+y);
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
5. SIMPLE CALCULATOR
DESIGN PAMPHLET
OUTPUT SCREEN
6. STUDENT RECORD
DESIGN PAMPHLET
OUTPUT SCREEN
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
String g;
float f= Float.parseFloat(t1.getText());
float s= Float.parseFloat(t2.getText());
float i= f+s;
float h=i/2;
if(r1.isSelected())
{ if(h>=80 && h<100)
g="A";
else if(h>=60 && h<80)
g="B";
else{
g="C";
} if(r2.isSelected())
{
if(h>=75)
g="A";
else if(h>=60 && h<75)
g="B";
else
g="C";
}
t3.setText(""+h);
t4.setText(""+g);
}
OUTPUT SCREEN
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
t1.setText("");
t2.setText("");
t3.setText("");
c1.setSelected(false);
r1.setSelected(false);
r2.setSelected(false);
r3.setSelected(false);
r4.setSelected(false);
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
8. SALARY CALCULATOR
DESIGN PAMPHLET
OUTPUT SCREEN
DESIGN PAMPHLET
OUTPUT SCREEN
CODE FOR ABOVE RESULT
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
float a= Float.parseFloat(t2.getText());
float b= Float.parseFloat(t3.getText());
float ab= a*b;
t4.setText(""+ab);
float sc;
if(r1.isSelected())
sc= 10*ab/100;
else if(r2.isSelected())
sc=15*ab/100;
else
sc=20*ab/100;
t5.setText(""+sc)
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
float ab= Float.parseFloat(t4.getText());
float sc= Float.parseFloat(t5.getText());
float np=sc+ab;
t6.setText(""+np);
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
10. FIBONACCI SERIES
DESIGN PAMPHLET
OUTPUT SCREEN
CODE FOR ABOVE RESULT
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int n= Integer.parseInt(t1.getText());
int a=0,c=0;
int b=1;
System.out.println(""+a+""+b);
while(c<=n)
{
c=a+b;
System.out.println(""+c);
a=b;
}
}
11. FIBONACCI SERIES
DESIGN PAMPHLET
OUTPUT SCREEN
CODE FOR ABOVE RESULT
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int a= Integer.parseInt(t1.getText());
int i,c=0;
for(i=2;i<a;i++)
{if(a%i==0)
c=1;
}
{if(c==1)
t2.setText("Not a prime");
else
t2.setText("Prime");
}
}
12. PIZZA CAFÉ
DESIGN PAMPHLET
OUTPUT SCREEN
CODE FOR ABOVE RESULT
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String a= t1.getText();
int b= Integer.parseInt(t2.getText());
if (r1.isSelected())
{ if(c1.isSelected())
t3.setText(""+(200+12)*b);
if(c2.isSelected())
t3.setText(""+(200+13)*b);
if(c3.isSelected())
t3.setText(""+(200+15)*b);
t3.setText(""+200*b);
}
else if(r2.isSelected())
{ if(c1.isSelected())
t3.setText(""+(500+12)*b);
if (c2.isSelected())
t3.setText(""+(500+13)*b);
if (c2.isSelected())
t3.setText(""+(500+15)*b);
t3.setText(""+500);
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
t1.setText("");
t2.setText("");
t3.setText("");
t3.setText("");
r1.setSelected(false);
r2.setSelected(false);
c1.setSelected(false);
c2.setSelected(false);
c3.setSelected(false);
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
13. PATTERN 1
DESIGN PAMPHLET
OUTPUT SCREEN
CODE FOR ABOVE RESULT
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int i,j;
for(i=1;i<=5;i++)
{System.out.println("");
for(j=1;j<=4;j++)
System.out.println("*");}
}
14. PATTERN 2
DESIGN PAMPHLET
OUTPUT SCREEN
CODE FOR ABOVE RESULT
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int i,j;
for(i=1;i<=5;i++)
{System.out.println("");
for(j=1;j<=4;j++)
System.out.print("*");
}
15. PATTERN 3
DESIGN PAMPHLET
OUTPUT SCREEN
CODE FOR ABOVE RESULT
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int i,j;
for(i=4;i>=1;i--)
{System.out.println("");
for(j=1;j<=i;j++)
System.out.print("*");
}
SQL QUERIES
Write Queries based on EMP table including following
EMP (EMPID, EMPNAME, DESIG, SAL, GRADE, DOB, DOJ, CITY)
1)Create database and open the database.
2)Create the table EMP with constraints(Primary key, not null, unique,
default)
5)Make a simple query using where clause including relational operators and
logical operators
6)Make a simple query using all keyword.
8)Show all records from EMP where the name contains the letter A.
9)Show all records from EMP where the name does not contain the letter A.
10)Show all records from EMP where the employee ID is between 1 and 3.
11)Show all records from EMP where employee ID is not between 1 and 3.
12)Show all records from EMP where Empname is either in Noida or Delhi.
13) Show all records from EMP where Empname is not either in Noida or Delhi.