Documente Academic
Documente Profesional
Documente Cultură
Practices
Project Report File
2014-15
Submitted By-
EXPERIMENT NO.
Aim - Design a GUI application to capitalize FIRST CHARCATER of each
Word of a string.
Convert Button
String a= tf.getText();
String b,c,d,f="",e;
int i = 1;
int num = a.length();
d = a.substring(1,num);
e = a.substring(0,1);
e = e.toUpperCase();
a = e+d;
do
{
b = a.substring(i,++i);
if (b.equals(""))
{
c = a.substring(0,i);
d = a.substring(i+1,num);
e = a.substring(i,i+1);
e = e.toUpperCase();
a = c+e+d;
}
} while(i<=num-1);
ctf.setText(a);
Exit Button
System.exit(0);
EXPERIMENT NO.
Aim - Design a GUI application to calculate sum of digits of a number.
Calculate Button
Exit Button
System.exit(0);
EXPERIMENT NO.
Aim - Design a GUI application to calculate factorial of a number.
Calculate Button
while(i<num)
{ i++;
fact= fact*i;
}
Exit Button
System.exit(0);
EXPERIMENT NO.
Aim - Design a GUI application to accept amount and customer type
from a user and thus calculate discount and final price to be paid. Also
offer and additional discount for VISA Debit card user.
Calculate Amount Button
if(cb.getSelectedIndex()==1)
d=0.1;
else if(cb.getSelectedIndex()==2)
d=0.2;
else if(cb.getSelectedIndex()==3)
d=0.4;
else d=0;
if(chb.isSelected()== true)
d= d+0.05;
Exit Button
System.exit(0);
EXPERIMENT NO.
Aim - Design a GUI application for a FOOTBALL match scoreboard.
Scored Goal Button(for Team GREEN)
int num = Integer.parseInt(tf1.getText());
num = num + 1;
tf1.setText(""+num);
if(num1>num2)
lbl.setText("WINNER IS TEAM GREEN");
else if (num1<num2)
lbl.setText("WINNER IS TEAM RED");
else
lbl.setText("MATCH IS DRAW");
Exit Button
System.exit(0);
EXPERIMENT NO.
Aim - Design a GUI application to sum of even and odd numbers up to a
number submitted in a text field.
Calculate Button
int num= Integer.parseInt(tf.getText());
int osm=0; int esm=0; int i=1; int j=0;
do
{osm=i+osm;
i=i+2;
}
while(i<=num);
ta.append("sum of odd nos. is "+osm);
do
{esm=j+esm;
j=j+2;
}
while(j<=num);
ta.append("\nsum of even nos. is "+esm);
Reset Button
tf.setText("");
ta.setText("");
Exit Button
System.exit(0);
EXPERIMENT NO.
Aim - Design a GUI application to create a 2D pyramid with no. of rows
entered by user using loops.
Calculate Button
String b="";
String a= "@"; int i=0;
int n;
n = Integer.parseInt(tf.getText());
ta.setText("");
do{
i=i+1;
for(int c=i;c<=n;c++)
{ta.append(b);}
for(int d=1;d<=(2*i-1);d++)
{ta.append(a);}
ta.append("\n");
} while(i<n);
Reset Button
tf.setText("");
ta.setText("");
Exit Button
System.exit(0);