Array Problems
for DIT111
Write a program that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111xxx.
for DIT112
Write a program that can accept five integers in an array. Display the integers from first to last, and then display the integers from last to first. Class name is ArrayDIT112xxx.
for DIT113
Create a program that will accept 20 prices of an item and store it in an array. Compute and display the sum of all prices. Display all the values less than 5.00. Calculate and display the average of the prices, and display all values higher than the calculated average value. Class name is ArrayDIT113xxx.
for BSCS112
Create an array of five strings. Write a program that counts and display the number of vowel in the string that you entered, without regard the case. Class name is ArrayBSCS112xxx.
for BSIT112
Write a program that will accept 10 integer numbers store in an array. Compute and display the average. If the average is below 75 display the average, if the average is above 75 compute and display the square root of the average otherwise display the sum. Class name is ArrayBSIT112xxx.
Java Applet Problems
for DIT211
Create an applet with a Button and TextField. Input your name and display it in an 8pt font when button is cliked. Everytime the user clicks the Button, increase the font size for the displayed name by four points. Remove the Button when the font size exceeds 24 points. Class name is AppletDIT211xxx.
for DIT221
Create an applet with a Button labeled "Who's the greatest?" When the user clicks the button, display your name in a large font. Class name is AppletDIT221xxx.
for BSCS211
Create an applet that asks a user to enter a password into a TextField and then press the enter key. Compare the password to "Rosebud"; if they match, display "Access Granted"; if not, display "Access Denied". Class name is AppletBSCS221xxx.
for BSCOE411
Create a payroll applet named AppletBSCOE411xxx that allows the user to enter two double values - hours worked and hourly rate. When the user clicks a Button, net pay is calculated. Federal withholding tax is subtracted from gross pay (hours worked * hourly rate) based on the following table:
Income ($) ___________________ Withholding (%)
0 to 99.99 ______________________10
100.00 to 299.99 _________________15
300.00 to 599.99 _________________21
600.00 and up ___________________28
Subscribe to:
Post Comments (Atom)
106 comments:
Write a program that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111xxx.
import java.io.*;
public class ArryDIT111LHP
{
public static void main (String args[]) throws IOException
{
BufferedReader leif=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],b=0,n=0,c;
for(b=0;b<20;b++)
{
System.out.print("\nEnter a Number "+(b+1)+": ");
a[b]=Integer.parseInt(leif.readLine());
}
System.out.print("\nThe Inputted Even Numbers are: \n");
for(b=0;b<20;b++)
{
c=a[b]%2;
if (c==0)
{
System.out.print("\n\t\t"+a[b]);
}
}
System.out.print("\n\nThis is the 1st Number You Enter: "+a[0]);
System.out.println("\n\nThis is the Last Number You Enter: "+a[19]);
}
}
hahaha... dami ko program na ginawa na pinag sama sama kaya sobra ung variable ko!
import java.io.*;
public class ArrayBSIT112epc
{
public static void main(String args[]) throws IOException
{
BufferedReader e = new BufferedReader (new InputStreamReader(System.in));
int a,b,ave;
int a[] = new int[10];
for(a=0;a<10;a++)
{
System.out.print("Enter the number: " + (a+1));
int[a]=Integer.parseInt(e.readLine());
}
b=0;
for(a=0;a<10;a++)
{
b=b+int[a];
a+1
ave=b/10;
}
if (ave<75)
{System.out.print("The average is: " + ave);}
else if (ave>75)
{
ave=log
log=log/2;
System.out.print("The square root is: " + ave);
}
}
EDUARDO CESARIO BSIT112
maam kayo nang bahala jan..hehehehe
salmat po
import java.io.*;
public class ArrayBSCS112hms
{
public static void main(String args[])throws IOException
{
BufferedReader in = new BufferedReader (new InputStreamReader (System.in));
string name=" ";
int a=0;
int e=0;
int o=0;
int i=0;
int u=0;
int n;
string name[] = new string [5];
for(name=0;name<5;name++)
{
System.out.print("The string is" + name);
name=(in.readLine());
}
int n;
n=txt.length();
for(i=0;i < n;i++)
if (txt.charAt(i)='a')
++vowels
else if (txt.charAt(i)='e')
++vowels
else if (txt.charAt(i)='i')
++vowels
else if (txt.charAt(i)='o')
++vowels
else if (txt.charAt(i)='u')
++vowels
}
}
}
Helbert Subaan BSCS112
di ko po sure..
import java.io.*;
public class ArrayBSIT112mda
{
public static void main(String args[]) throws IOException
{
BufferedReader e = new BufferedReader (new InputStreamReader(System.in));
int a,b,ave;
int a[] = new int[10];
for(a=0;a<10;a++)
{
System.out.print("Enter the number: " + (a+1));
int[a]=Integer.parseInt(e.readLine());
}
b=0;
for(a=0;a<10;a++)
{
b=b+int[a];
a+1
ave=b/10;
}
if (ave<75)
{System.out.print("The average is: " + ave);}
else if (ave>75)
{
ave=log
log=log/2;
System.out.print("The square root is: " + ave);
}
}
MONROVIA D. AMARILLO
GUDLUK SA AKIN!!!!
SANA TAMA 2!! hahaha
import java.io.*;
public class ArrayBSCS112jlj
{
public static void main(String args[])throws IOException
{
BufferedReader anzem = new BufferedReader (new InputStreamReader (System.in));
string name=" ";
int a=0;
int e=0;
int o=0;
int i=0;
int u=0;
int n;
string name[] = new string [5];
for(name=0;name<5;name++)
{
System.out.print("The string is" + name);
name=(anzem.readLine());
}
int n;
n=txt.length();
for(i=0;i < n;i++)
if (txt.charAt(i)='a')
++vowels
else if (txt.charAt(i)='e')
++vowels
else if (txt.charAt(i)='i')
++vowels
else if (txt.charAt(i)='o')
++vowels
else if (txt.charAt(i)='u')
++vowels
}
}
}
import java.io.*;
public class ArrayBsit112gcl
{
public static void main(Sting args[]) throws IOException
{
BufferedReader in=new BufferedReader (new InputStreamReader(System.in));
int a, sum=0, ave=0;
int g[];
g=new int [10];
for (a=0;a<10;a++)
{
System.out.print("Enter number: ");
g=Integer.parseInt(in.readLine());
sum+=g;
ave=sum/10;
ave=log;
log=log/2
}
System.out.print("The average is " +ave);
if (ave<75)
System.out.print(" " +ave);
if (ave>75)
System.out.print(" " +log);
else
System.out.print(" " +sum);
}
}
Create an array of five strings. Write a program that counts and display the number of vowel in the string that you entered, without regard the case. Class name is ArrayBSCS112xxx.
import java.io.*;
public class sampleArraysml
{
public static void main (String args []) throws IOException
{
BufferedReader m=new BufferedReader (new InputStreamReader (System.in));
StringName="a,e,i,o,u";
StringName[];
name=new String [5];
for(name=0; name<5; name++)
{
System.out.print("Enter the no. of vowel");
name[]=(x.readLine());
}
}
}
\\Sharmine Lingayo BSCS112
~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~
Create an array of five strings. Write a program that counts and display the number of vowel in the string that you entered, without regard the case. Class name is ArrayBSCS112xxx.
mAm ArcE..
aNswer q pUh..
import java.io.*;
public class sampleArrayjcoc
{
public static void main (String args []) throws IOException
{
BufferedReader jc=new BufferedReader (new InputStreamReader (System.in));
String nAme="";
name=new String[];
String name[]=new String[5];
for(name=0; name<5; name++)
{
System.out.print("The Stringname is " +name);
{
System.out.print("Enter number of vowels "+(a,e,i,o,u));
name[5]=(jr.readLine());
}
}
}
~..mArjOriE A. sErgAnTesBSCS112
import java.io.*;
public class BSIT112aki
{
public static void main(String args[])throws IOException
{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
int num[]=new int [10];
float ave=0f;
int sum=0;
double square=0.0;
for (int i=0;i<10; i++)
{
System.out.print("\n Enter number: ");
num[i]=Integer.parseInt(in.readLine());
sum+=num[i];
ave=sum/10;
}
if (ave<75){
System.out.print("Average is: " + ave);
}else if (ave>75){
square=Math.sqrt(ave);
System.out.print("\n the square root is: " + square);
}else{
System.out.print("\n The sum is: " + sum);}
}
}
import java.io.*;
public class BSIT112bgm
{
public static void main(String args[])throws IOException
{
BufferedReader bgm=new BufferedReader(new InputStreamReader(System.in));
int a[]=new int [10];
float average=0f;
int sum=0;
double squareroot=0.0;
for (int i=0;i<10; i++)
{
System.out.print("\n Enter integer number: ");
a[i]=Integer.parseInt(bgm.readLine());
sum+=a[i];
average=sum/10;
}
if (average<75){
System.out.print("Average is: " + average);
}else if (average>75){
squareroot=Math.sqrt(average);
System.out.print("\n the square root is: " + squareroot);
}else{
System.out.print("\n The sum is: " + sum);}
}
}
bernalyn manjares
\*Franz Ian Alucilja*\
sure na to mam'
nagrun sa amin..
import java.io.*;
public class Array
{
public static void main (String args []) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int a, sum,ave;
double sqroot;
int num [] = new int[10];
for ( a=0; a<10; a++)
{
System.out.print ("Enter 10 integers: " + (a+1)+ ">>");
num[a] = Integer.parseInt(x.readLine());
}
sum=0;
sqroot=0;
for(a=0; a<10; a++)
{
sum=sum + num[a];
}
ave=sum/10;
if(ave<75)
{
System.out.print("The average is: " + ave);
}
else if(ave>75)
{
sqroot=Math.sqrt(ave);
System.out.print("The square root is: " + sqroot);
}
else
{
System.out.print("The sum is: " + sum);
}
}
}
Write a program that will accept 20 integer numbers in an array. Determine and didplay also the first and last element of the array. class name is arrayDIT111xxx.
import java.io.*;
public class arrayDIT111ual
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int u[]=new int[20],l,
i=0,r=0;
for(r=0;r<20;r++)
{
System.out.print("Enter Number: ");
u[r]=Integer.parseInt(x.readLine());}
System.out.print("The Even Numbers are: "+i);
for(r=0;r<20;r++)
{
i=u[r]%2;
if (i==0)
{
System.out.print(""+u[r]);}
}
System.out.print("\nThe first number is: "+u[0]);
System.out.println("\nThe last number is: "+u[19]);
}
}
URICA A. LASPINAS
DIT111
import java.io.*;
public class ArrayBSIT112njv
{
public static void main (String args []) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int d, sum,ave;
double sqroot;
int num [] = new int[10];
for ( d=0; d<10; d++)
{
System.out.print ("Enter 10 integers: "+(d+1)+">>");
num[d]=Integer.parseInt(x.readLine());
}
sum=0;
sqroot=0;
for(d=0; d<10; d++)
{
sum=sum + num[d];
}
ave = sum/10;
if (ave<75)
{
System.out.print("The average is: " + ave);
}
else if(ave>75)
{
sqroot=mathsquaret(ave);
System.out.print("The squareroot is: " +sqroot);
}
else
{
System.out.print("The sum is:" + sum);
}
}
}
<< NicoLe JoHn G. ViraY BSIT112
Create an array of five strings. Write a program that counts and display the number of vowel in the string that you entered, without regard the case. Class name is ArrayBSCS112xxx.
Jemar Christopher O. Cristobal
import java.io.*;
public class ArrayBSCS112jcoc
{
public static void main(String args[])throws IOException
{
BufferedReader jcoc = new BufferedReader (new InputStreamReader (System.in));
string name=" ";
int a=0;
int e=0;
int o=0;
int i=0;
int u=0;
int n;
string name[] = new string [5];
for(name=0;name<5;name++)
{System.out.print("The string is" + name);
name=(jcoc.readLine());
}
int n;
n=txt.length();
for(i=0;i < n;i++)
if (txt.charAt(i)='a')
++vowels;
else if (txt.charAt(i)='e')
++vowels;
else if (txt.charAt(i)='i')
++vowels;
else if (txt.charAt(i)='o')
++vowels;
else if (txt.charAt(i)='u')
++vowels;
}
}
}
import java.io.*;
public class arraybsit112gga
{
public static void main (String args []) throws IOException
{
BufferedReader in=new BufferedReader (new InputStreamReader (System.in));
int a,b=10,c,sum;
double x = 0.0;
int num[]=new int[10];
sum=0;
for(a=0;a<10;a++)
{
System.out.print("Please enter the ["+(a+1)+"]number : >>>> ");
num[a]=Integer.parseInt(in.readLine());
sum=sum+num[a];
}
c=sum/b;
if (c>75)
{
x=Math.sqrt(c);
System.out.print("The squareroot of the average is: "+x);
}
else if (c<75)
{
System.out.print("The average of all number you had given is: "+c);
}
else
{
System.out.print("The sum of all number you had input is: "+sum);
}
}
}
Sorry po mam delete ko older post ko .. me in-edit lang akong konti eh...
Gaylord Alfonso BSIT 112
Write a program that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111lal.
import java.io.*;
public class ArrayDIT111lal
{
public static void main(String args[])throws IOException
{
BufferedReader j=new BufferedReader(new InputStreamReader(System.in));
int a,d=0;
int num[]=new int[20];
for(a=0;a<20;a++)
{
System.out.print("Enter number "+(a+1)+">> ");
num[a]=Integer.parseInt(j.readLine());
}
System.out.print("\n\n The even numbers are :\n");
for (a=0;a<20;a++)
{
d=num[a]%2;
if(d==0)
{
System.out.println(""+num[a]);
}
}
System.out.print("\n The 1st element of an array is "+num[0]);
System.out.print("\n The last element of an array is "+num[19]);
}
}
WAP that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111xxx.
import java.io.*;
public class ArrayDIT111mfc
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],b=0,c=0,d;
for(b=0;b<20;b++)
{
System.out.print("\nEnter Number "+(b+1)+": ");
a[b]=Integer.parseInt(x.readLine());
}
System.out.print("\nThe Even Numbers are: \n");
for(b=0;b<20;b++)
{
d=a[b]%2;
if (d==0)
{
System.out.print("\n"+a[b]);
}
}
System.out.print("\n\nThe 1st Number is: "+a[0]);
System.out.println("\n\nThe Last Number is: "+a[19]);
}
}
midKNIGHTe ( CAMONIAS )
DIT 111
††† "i faLL d0wn, s0uLs ar0uNd mE scReAminG, yEt siLeNt cRiEs aRe aLL i heAr.." †††
import java.io.*;
public class ArrayDIT111aoa
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int a[]=new int[20],c,
s=0,r=0;
for(r=0;r<20;r++)
{
System.out.print("Enter Number: ");
a[r]=Integer.parseInt(x.readLine());}
System.out.print("The Even Numbers are: "+s);
for(r=0;r<20;r++)
{
s=a[r]%2;
if (s==0)
{
System.out.print(""+a[r]);}
}
System.out.print("\nThe first number is: "+a[0]);
System.out.println("\nThe last number is: "+a[19]);
}
}
Write a program that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111xxx.
Mam e2 akin hehehehe
+devil+alvin+ 15
+Acesor+
import java.io.*;
public class ArrayDIT111mfc
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],b=0,c=0,d;
for(b=0;b<20;b++)
{
System.out.print("\nEnter Number "+(b+1)+": ");
a[b]=Integer.parseInt(x.readLine());
}
System.out.print("\nThe Even Numbers are: \n");
for(b=0;b<20;b++)
{
d=a[b]%2;
if (d==0)
{
System.out.print("\n"+a[b]);
}
}
System.out.print("\n\nThe 1st Number is: "+a[0]);
System.out.println("\n\nThe Last Number is: "+a[19]);
}
}
dan jewel fojas dit 111
Write a program that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111xxx.
import java.io.*;
public class arrayDIT111jca
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int u[]=new int[20],l,
i=0,r=0;
for(r=0;r<20;r++)
{
System.out.print("Enter Number: ");
u[r]=Integer.parseInt(x.readLine());}
System.out.print("The Even Numbers are: "+i);
for(r=0;r<20;r++)
{
i=u[r]%2;
if (i==0)
{
System.out.print(""+u[r]);}
}
System.out.print("\nThe first number is: "+u[0]);
System.out.println("\nThe last number is: "+u[19]);
}
}
Joseph Amparo
DIT 111
Write a program that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111xxx.
import java.io.*;
public class ArrayDIT111ssa
{
public static void main(String args[])throws IOException
{
BufferedReader x=new BufferedReader(new InputStreamReader(System.in));
int a,b=0
int num[]=new int[20];
for(a=0;a<20;a++)
{
System.out.print("Enter number"+(a+1)">> ");
num[a]=Integer.parseInt(x.readLine());
}
System.out.print("\n\n The even numbers are :\n");
for(a=0;a<20;a++)
{
b=num[a]%2;
if(b==0)
{
System.out.println(""+num[a];
}
}
Sytem.out.print("\n The 1st element of an array is" +num[0]);
System.out.print("\n The last element of an array is" +num[19]);
}
}
Shirriel azcarrate
dit111
Write a program that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111xxx.
import java.io.*;
public class ArrayDIT111rto
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],r=0,t=0,o;
for(r=0;r<20;r++)
{
System.out.print("\nEnter Number "+(r+1)+": ");
a[r]=Integer.parseInt(x.readLine());
}
System.out.print("\nYour Even Numbers are: \n");
for(r=0;r<20;r++)
{
o=a[r]%2;
if (o==0)
{
System.out.print("\n"+a[r]);
}
}
System.out.print("\n\n1st Number is: "+a[0]);
System.out.println("\n\nLast Number is: "+a[19]);
}
}
mam sana po tama...
Rochelle T. Ocan
DIT 111
Write a program that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111xxx
import java.io.*;
public class ArrayDIT111cmd
{
public static void main(String args[])throws IOException
{
BufferedReader x=new BufferedReader(new InputStreamReader(System.in));
int a,even;
even=0;
int aR[]=new int[20];
for (a=0;a<20; a++);
{
System.out.print("Enter number:");
aR[a]=Integer.parseInt(x.readLine());
}
System.out.print("All even number: \n "+even);
for(a=0; a<20; a++);
{
even=aR[a]%2;
if (even==0)
{
System.out.print(""+aR[a]);
}
}
System.out.print("The first element of array is: \n" +aR[0]);
System.out.print("The last element of array is: \n" +aR[19]);
}
}
Dalawampo Cecil M.
DIT111
Write a program that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111xxx.
import java.io.*;
public class arrayDIT111abp
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int c[]=new int[20],l,
z=0,r=0;
for(r=0;r<20;r++)
{
System.out.print("Enter Number: ");
c[r]=Integer.parseInt(x.readLine());}
System.out.print("The Even Numbers are: "+z);
for(r=0;r<20;r++)
{
z=c[r]%2;
if (z==0)
{
System.out.print(""+c[r]);}
}
System.out.print("\nThe first number is: "+c[0]);
System.out.println("\nThe last number is: "+c[19]);
}
}
Angelo Pelaez
DIT111
import java.io.*;
public class ArrayDIT111rmt
{
public static void main(String args[])throws IOException
{
BufferedReader j=new BufferedReader(new InputStreamReader(System.in));
int a,d=0;
int num[]=new int[20];
d=0,t=0
for(a=0;a<20;a++)
{
System.out.print("Enter number ["+(a+1)+"]: ");
num[a]=Integer.parseInt(j.readLine());
}
System.out.print("\n\n The even numbers are :\n");
for (a=0;a<20;a++)
{
d=num[a]%2;
if(d==0)
{
System.out.println(""+num[a]);
}
}
System.out.print("\n The 1st element of an array is "+num[0]);
System.out.print("\n The last element of an array is "+num[19]);
}
}
rhodora tagaya
DIT111
//*Write a program that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111xxx.*//
import java.io.*;
public class ArrayDIT111mjc
{
public static void main (String args[])throws IOException
{
BufferedReader x=new BufferedReader(new InputStreamReader(System.in));
int a[] = new int[20],m=0,j=0,c;
for(m=0;m<20;m++)
{
System.out.print("\nEnter number "+(m+1)+" ");
a[m]=Integer.parseInt(x.readLine());
}
System.out.print("\nThe even numbers are \n");
for(m=0;m<20;m++)
{
c=a[m]%2;
if (c==0)
{
System.out.print("\n"+a[m]);}
}
System.out.print("\nThe first number is "+a[0]);
System.out.println("\nThe last number is "+a[19]);
}
}
Michelle Calapit
DIT111
//Write a program that will accept 20integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111xxx.//
import java.io.*;
public class ArrayDIT111ibj
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],i=0,b=0,j;
for(i=0;i<20;i++)
{
System.out.print("\nEnter Number"+(i+1)+"");
a[i]=Integer.parseInt(x.readLine());
}
System.out.print("\nYour Even Numbers are \n");
for(i=0;i<20;i++)
{
j=a[i]%2;
if(j==0)
{
System.out.print("\n"+a[i]);
}
}
System.out.print("\n\n1st Number is: "+a[0]);
System.out.println("\n\nLast Number is: "+a[19]);
}
}
ira jastivaDIT111
//Joy Kristine Tabunan//
import java.io.*;
public class BSIT112jkft
{
public static void main(String args[])throws IOException
{
BufferedReader jkft=new BufferedReader(new InputStreamReader(System.in));
int b[]=new int [10];
float jkft_average=0f;
int sum=1;
double sr= 2.9;
for (int i=0;i<10; i++)
{
System.out.print("\n Enter integer number " + "-->>");
b[i]=Integer.parseInt(jkft.readLine());
sum+=b[i];
jkft_average=sum/10;
}
if (jkft_average<75){
System.out.println("\nAverage is: " + jkft_average);
}
else if (jkft_average> 75 )
{
sr=Math.sqrt(jkft_average);
System.out.println("\n SquareRoot is: " + sr);
}
else
{
System.out.print("\n The sum is: " + sum);
}
}
}
import java.io.*;
public class arraybsit112RCN
{
public static void main (String args []) throws IOException
{
BufferedReader in=new BufferedReader (new InputStreamReader (System.in));
int x, b=10 ,y , sum;
double x = 0.0;
int num[]= new int [10];
sum=0;
for(x=0;x<10;x++)
{
System.out.print("Please enter the ["+(x+1)+"]number : >>>> ");
num[x]=Integer.parseInt(in.readLine());
sum=sum+num[x];
}
y=sum/b;
if (y>75)
{
x=Math.sqrt(y);
System.out.print("The squareroot of the average is: "+x);
}
else if (y<75)
{
System.out.print("The average of all number you had given is: "+y);
}
else
{
System.out.print("The sum of all number you had input is: "+sum);
}
}
}
<< Ronald Nanez BSIT 112
Create an array of five strings. Write a program that counts and display the number of vowel in the string that you entered, without regard the case. Class name is ArrayBSCS112xxx.
import java.io.*;
public class ArrayBSCS112jps
{
public static void main(String args[])throws IOException
{
BufferedReader in = new BufferedReader (new InputStreamReader (System.in));
string name=" ";
int a=0;
int e=0;
int o=0;
int i=0;
int u=0;
int n;
string name[] = new string [5];
for(name=0;name<5;name++)
{
System.out.print("The string is" + name);
name=(in.readLine());
}
int n;
n=txt.length();
for(i=0;i < n;i++)
if (txt.charAt(i)='a')
++vowels
else if (txt.charAt(i)='e')
++vowels
else if (txt.charAt(i)='i')
++vowels
else if (txt.charAt(i)='o')
++vowels
else if (txt.charAt(i)='u')
++vowels
}
}
}
___mam c jervy sardona pOh 2 bscs112___
__ e2 poh ung gawa ko__
__tnx po ingat nlang poH plaGi^_^
import java.io.*;
public class sampleArrayabe
{
public static void main (String args []) throws IOException
{
BufferedReader m=new BufferedReader (new InputStreamReader (System.in));
StringName="a,e,i,o,u";
StringName[];
name=new String [5];
for(name=0; name<5; name++)
{
System.out.print("Enter the no. of vowel");
name[]=(x.readLine());
}
}
}
eow abe laureta po 2>>>>>take cre mam__i wish correct___heheheheh
Write a program that will accept 20 integer numbers in an array. Determine and display all the even numbers. Display also the first and the last element of the array. Class name is ArrayDIT111csr.
import java.io.*;
public class ArrayDIT111csr
{
public static void main(String args[]) throws IOException
{
BufferedReader l=new BufferedReader(new InputStreamReader(System.in));
int a,c=0;
int num[]=new int[20];
for(a=0;a<20;a++)
{
System.out.print("Enter number "+(a+1)+">> ");
num[a]=Integer.parseInt(l.readLine());
}
System.out.print("\n\n The even numbers are :\n");
for (a=0;a<20;a++)
{
c=num[a]%2;
if(c==0)
{
System.out.println(""+num[a]);
}
}
System.out.print("\n The 1st element of an array is "+num[0]);
System.out.print("\n The last element of an array is "+num[19]);
}
}
Crestita S. Ramo
DIT111
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class SUMAPPLET extends Applet implements ActionListener
{
Button sum,clear;
Label lbl1,lbl2;
TextField txt1,txt2;
public void init()
{
setVisible(true);
setSize(400,400);
setBackground(Color.PINK);
setLayout(null);
sum=new Button("SUM");
sum.setBackground(Color.RED);
sum.setBounds(15,140,90,40);
sum.addActionListener(this);
add(sum);
clear=new Button("CLEAR");
clear.setBackground(Color.RED);
clear.setBounds(15,200,90,40);
clear.addActionListener(this);
add(clear);
lbl1=new Label("1st NUMBER:");
lbl1.setBounds(40,50,80,40);
add(lbl1);
lbl2=new Label("2nd NUMBER:");
lbl2.setBounds(40,90,90,40);
add(lbl2);
txt1=new TextField("");
txt1.setBackground(Color.ORANGE);
txt1.setBounds(170,50,80,40);
add(txt1);
txt2=new TextField("");
txt2.setBackground(Color.ORANGE);
txt2.setBounds(170,90,80,40);
add(txt2);
}
public void actionPerformed(ActionEvent w)
{
if(w.getSource()==sum)
{
int a,b,c;
a=Integer.parseInt(txt1.getText());
b=Integer.parseInt(txt2.getText());
c=a+b;
JOptionPane.showMessageDialog(null,"Answer is " +c);
}
if(w.getSource()==clear)
{
txt1.setText("");
txt2.setText("");
sum.setEnabled(true);
clear.setEnabled(true);
}
}
}
ma'am ayaw po talga magpost eh . . . my html cannot be accepted dw po tpos tag is broken. . .
import java.io.*;
public class jvvim
{
public static void main(String args[])throws IOException
{
BufferedReader x=new BufferedReader(new InputStreamReader(System.in));
int num[]=new int [10];
float ave=0f;
int sum=0;
double square=0.0;
for (int i=0;i<10; i++)
{
System.out.print("\n Enter number: ");
num[i]=Integer.parseInt(x.readLine());
sum+=num[i];
ave=sum/10;
}
if (ave<75){
System.out.print("Average is: " + ave);
}else if (ave>75){
square=Math.sqrt(ave);
System.out.print("\n the square root is: " + square);
}else{
System.out.print("\n The sum is: " + sum);}
}
}
jacob Mancenido po!
BSIT-112
//Create an array of five strings. Write a program that counts and display the number of vowel in the string that you entered, without regard the case. Class name is ArrayBSCS112xxx.//
import java.io.*;
public class arrayBSCS112lpg
{
public static void main(String args[])throws IOException
{
BufferedReader x=new BufferedReader(new IputStreamReader(System.in));
String a,e,i,o,u;
re=new String [5];
for(re=0;re<5;re++)
{
System.out.print("\nEnter the number of vowel")
re=(x.readLine());
}
}
}
Lyann P. Gavarra
////Write a program that will accept 10 integer numbers store in
an array. Compute and display the average. If the average is
below 75 display the average, if the average is above 75
compute and display the square root of the average otherwise
display the sum. Class name is ArrayBSIT112xxx./////
[JARED ABEL BSit112]
import java.io.*;
public class BSIT112JRA
{
public static void main(String args[])throws IOException
{
BufferedReader JRA=new BufferedReader(new InputStreamReader(System.in));
int c[]=new int [10];
float JRA_average=0f;
int sum=1;
double sr= 2.9;
for (int i=0;i<10; i++)
{
System.out.print("\n Enter your integer number: t\t\t " + "is ");
c[i]=Integer.parseInt(JRA.readLine());
sum+=c[i];
JRA_average=sum/10;
}
if (JRA_average<75){
System.out.println("\nAverage is: " + JRA_average);
}
else if (JRA_average> 75 )
{
sr=Math.sqrt(JRA_average);
System.out.println("\n SquareRoot is: " + sr);
}
else
{
System.out.print("\n The sum is: " + sum);
}
}
}
mam jared po eto, next time magaaral na tlga ako sayo, promise...!!!!=)
Create an array of five strings. Write a program that counts and display the number of vowel in the string that you entered, without regard the case. Class name is ArrayBSCS112xxx.
Cherrie lyn C. Jagmoc
BSCS - 112
import java.io.*;
public class ArrayBSCS112hms
{
public static void main(String args[])throws IOException
{
BufferedReader in = new BufferedReader (new InputStreamReader (System.in));
string name=" ";
int a=0;
int e=0;
int o=0;
int i=0;
int u=0;
int n;
string name[] = new string [5];
for(name=0;name<5;name++)
{
System.out.print("The string is" + name);
name=(in.readLine());
}
int n;
n=txt.length();
for(i=0;i < n;i++)
if (txt.charAt(i)='a')
++vowels
else if (txt.charAt(i)='e')
++vowels
else if (txt.charAt(i)='i')
++vowels
else if (txt.charAt(i)='o')
++vowels
else if (txt.charAt(i)='u')
++vowels
}
}
}
Write a program that will accept 10 integer numbers store in an array. Compute and display the average. If the average is below 75 display the average, if the average is above 75 compute and display the square root of the average otherwise display the sum. Class name is ArrayBSIT112xxx.
Jerwis Jim N. Red
BSIT 112
import java.io.*;
public class BSIT112aki
{
public static void main(String args[])throws IOException
{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
int num[]=new int [10];
float ave=0f;
int sum=0;
double square=0.0;
for (int i=0;i<10; i++)
{
System.out.print("\n Enter number: ");
num[i]=Integer.parseInt(in.readLine());
sum+=num[i];
ave=sum/10;
}
if (ave<75){
System.out.print("Average is: " + ave);
}else if (ave>75){
square=Math.sqrt(ave);
System.out.print("\n the square root is: " + square);
}else{
System.out.print("\n The sum is: " + sum);}
}
}
Write a program that will accept 10 integer numbers store in an array. Compute and display the average. If the average is below 75 display the average, if the average is above 75 compute and display the square root of the average otherwise display the sum. Class name is ArrayBSIT112xxx.
Jerick I. Bayotas
BSIT 112
import java.io.*;
public class ArrayBSIT112epc
{
public static void main(String args[]) throws IOException
{
BufferedReader e = new BufferedReader (new InputStreamReader(System.in));
int a,b,ave;
int a[] = new int[10];
for(a=0;a<10;a++)
{
System.out.print("Enter the number: " + (a+1));
int[a]=Integer.parseInt(e.readLine());
}
b=0;
for(a=0;a<10;a++)
{
b=b+int[a];
a+1
ave=b/10;
}
if (ave<75)
{System.out.print("The average is: " + ave);}
else if (ave>75)
{
ave=log
log=log/2;
System.out.print("The square root is: " + ave);
}
}
mam kau n poh bhala jan!!
Create an array of five strings. Write a program that counts and display the number of vowel in the string that you entered, without regard the case. Class name is ArrayBSCS112xxx.
Francis L. Plata
BSCS 112
import java.io.*;
public class ArrayBSCS112hms
{
public static void main(String args[])throws IOException
{
BufferedReader in = new BufferedReader (new InputStreamReader (System.in));
string name=" ";
int a=0;
int e=0;
int o=0;
int i=0;
int u=0;
int n;
string name[] = new string [5];
for(name=0;name<5;name++)
{
System.out.print("The string is" + name);
name=(in.readLine());
}
int n;
n=txt.length();
for(i=0;i < n;i++)
if (txt.charAt(i)='a')
++vowels
else if (txt.charAt(i)='e')
++vowels
else if (txt.charAt(i)='i')
++vowels
else if (txt.charAt(i)='o')
++vowels
else if (txt.charAt(i)='u')
++vowels
}
}
}
/*Create a program that will accept 20 prices of an item and store it in an array. Compute
and display the sum of all prices. Display all the values less than 5.00. Calculate and
display the average of the prices, and display all values higher than the calculated
average value. Class name is ArrayDIT113xxx.*/
import java.io.*;
public class ArrayDIT113reu
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader(System.in));
int sum,ave1,ave2,less,high,a;
int price[]=new int[5];
sum = 0;
ave1 = 0;
ave2 = 0;
less = 0;
high = 0;
for(a=0;a<5;a++)
{
System.out.print("Enter price: ");
price[a] = Integer.parseInt(x.readLine());
sum=price[a]+sum;
if (price[a]<5)
{
less = price[a] + less;
ave1 = less/price[a];
}
else if(price[a]>5)
{
high = price[a] + high;
ave2 = high/price[a];
}
}
System.out.println("The sum of the 20 prices entered is " +sum);
System.out.println("The sum of the prices Less Than 5 is : " +less);
System.out.println("the average of the prices less than 5 is : " +ave1);
System.out.println("the sum of all prices higher than 5 is : " +high);
System.out.println("The average of all prices higher than 5 is : " +ave2);
}
}
....UMALI, RONALYN E. DIT113....
ayyy e2 po ung original!!!
ng-try lang na po ako muna sa 5 integers.. hehe.. cenxa!!
/*Create a program that will accept 20 prices of an item and store it in an array. Compute
and display the sum of all prices. Display all the values less than 5.00. Calculate and
display the average of the prices, and display all values higher than the calculated
average value. Class name is ArrayDIT113xxx.*/
import java.io.*;
public class ArrayDIT113reu
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader(System.in));
int sum,ave1,ave2,less,high,a;
int price[]=new int[20];
sum = 0;
ave1 = 0;
ave2 = 0;
less = 0;
high = 0;
for(a=0;a<5;a++)
{
System.out.print("Enter price: ");
price[a] = Integer.parseInt(x.readLine());
sum=price[a]+sum;
if (price[a]<20)
{
less = price[a] + less;
ave1 = less/price[a];
}
else if(price[a]>20)
{
high = price[a] + high;
ave2 = high/price[a];
}
}
System.out.println("The sum of the 20 prices entered is " +sum);
System.out.println("The sum of the prices Less Than 5 is : " +less);
System.out.println("the average of the prices less than 5 is : " +ave1);
System.out.println("the sum of all prices higher than 5 is : " +high);
System.out.println("The average of all prices higher than 5 is : " +ave2);
}
}
... UMALI, RONALYN E. DIT113...
import java.io.*;
public class ArryDIT111mqa
{
public static void main (String args[]) throws IOException
{
BufferedReader leif=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],b=0,n=0,c;
for(b=0;b<20;b++)
{
System.out.print("\nEnter a Number "+(b+1)+": ");
a[b]=Integer.parseInt(leif.readLine());
}
System.out.print("\nThe Inputted Even Numbers are: \n");
for(b=0;b<20;b++)
{
c=a[b]%2;
if (c==0)
{
System.out.print("\n\t\t"+a[b]);
}
}
System.out.print("\n\nThis is the 1st Number You Enter: "+a[0]);
System.out.println("\n\nThis is the Last Number You Enter: "+a[19]);
}
}
import java.io.*;
public class ArryDIT111mqa
{
public static void main (String args[]) throws IOException
{
BufferedReader leif=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],b=0,n=0,c;
for(b=0;b<20;b++)
{
System.out.print("\nEnter a Number "+(b+1)+": ");
a[b]=Integer.parseInt(leif.readLine());
}
System.out.print("\nThe Inputted Even Numbers are: \n");
for(b=0;b<20;b++)
{
c=a[b]%2;
if (c==0)
{
System.out.print("\n\t\t"+a[b]);
}
}
System.out.print("\n\nThis is the 1st Number You Enter: "+a[0]);
System.out.println("\n\nThis is the Last Number You Enter: "+a[19]);
}
}
import java.io.*;
public class ArryDIT111mqa
{
public static void main (String args[]) throws IOException
{
BufferedReader leif=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],b=0,n=0,c;
for(b=0;b<20;b++)
{
System.out.print("\nEnter a Number "+(b+1)+": ");
a[b]=Integer.parseInt(leif.readLine());
}
System.out.print("\nThe Inputted Even Numbers are: \n");
for(b=0;b<20;b++)
{
c=a[b]%2;
if (c==0)
{
System.out.print("\n\t\t"+a[b]);
}
}
System.out.print("\n\nThis is the 1st Number You Enter: "+a[0]);
System.out.println("\n\nThis is the Last Number You Enter: "+a[19]);
}
}
mam e2 na po ung assignment ko
c carine mendoza po 2. dit 113.
import java.io.*;
public class ARRAYDIT113csm
{
public static void main (String args[]) throws IOException
{
int a,b,c,sum,average1,average2;
int item[]=new int[20];
BufferedReader x=new BufferedReader (new InputStreamReader(System.in));
sum=0;
b=0;
c=0;
average1=0;
average2=0;
for(a=0;a<20;a++)
{
System.out.print("Enter item price: ");
item[a] = Integer.parseInt(x.readLine());
sum=item[a]+sum;
if (item[a]<20)
{
b=item[a] + b;
average1=b/item[a];
}
else if(item[a]>20)
{
c=item[a]+c;
average2=c/item[a];
}
}
System.out.print("\n\n The sum of the 20 prices entered is " +sum);
System.out.print("\n\n The sum of the prices Less Than 5 is : " +b);
System.out.print("\n\n The sum of all prices higher than 5 is : " +c);
System.out.print("\n\n The average of the prices less than 5 is : " +average1);
System.out.print("\n\n The average of all prices higher than 5 is : " +average2);
}
}
import java.io.*;
public class ArryDIT111kmb
{
public static void main (String args[]) throws IOException
{
BufferedReader leif=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],b=0,n=0,c;
for(b=0;b<20;b++)
{
System.out.print("\nEnter a Number "+(b+1)+": ");
a[b]=Integer.parseInt(leif.readLine());
}
System.out.print("\nThe Inputted Even Numbers are: \n");
for(b=0;b<20;b++)
{
c=a[b]%2;
if (c==0)
{
System.out.print("\n\t\t"+a[b]);
}
}
System.out.print("\n\nThis is the 1st Number You Enter: "+a[0]);
System.out.println("\n\nThis is the Last Number You Enter: "+a[19]);
}
}
.,hi sana ipasa m kme@!!!!!!!!!!!!!!mwaaaahhhhhhhh
..hi ma'am ganda moe ngeon pra kng dioza!!!!!!!.,hehe.,ipasa m nmn poe aqoe pra msaya!!!!!.,hehe.,yngat poe sexy moe tlaga!!!wiwitttttttt.,hehe.,mwahh
import java.io.*;
import java.io.*;
public class ArrayDIT113janna
{
public static void main(String args[]) throws IOException
{
BufferedReader j=new BufferedReader (new InputStreamReader (System.in));
int price[] = new int[20],r,sum=0,ave1=0,high=0,less=0,ave2;
for(r=0;r<20;r++)
{System.out.print("\n\nEnter price");
price[r]=Integer.parseInt(j.readLine());
sum= price[r]+sum;
if (price[r]>20);
{ high= price[r]+high;
ave1=high/ price[r]; }
if
(price[r]<20);
{ less= price[r]+less;
ave2=less/price[r]; }
}System.out.print("\nThe sum of all 20 prices is"+sum);
System.out.print("\nThe sum of the prices higher than 5 is" +high);
System.out.print("\nThe ave of the prices higher than 5 is "+ave1);
System.out.print("\nThe sum of all prices less than 5 is" +less);
System.out.print("\nThe ave of the prices less than 5 is "+less);
}
}
maam its me janna em nojor from dit-113 im sure i got it!lol
//*Alexander R. Mores*//
import java.io.*;
public class ArrayDIT113alex
{
public static void main(String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int num[] = new int[20],a,b=0,c=0,sum=0,average1=0,average2;
for(a=0;a<20;a++)
{System.out.print("\n\nEnter the price: ");
num[a]=Integer.parseInt(x.readLine());
sum=num[a]+sum;
if (num[a]>20);
{b=num[a]+b;
average1=b/num[a];}
if
(num[a]<20);
{c=num[a]+c;
average2=c/num[a];}
}System.out.print("\nThe sum of all 20 prices is "+sum);
System.out.print("\nThe sum of the prices higher than 5 is "+b);
System.out.print("\nThe average of the prices higher than 5 is "+average1);
System.out.print("\nThe sum of all prices less than 5 is "+c);
System.out.print("\nThe average of the prices less than 5 is "+c);
}
}
import java.io.*;
public class ArrayJPQ
{
public static void main(String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int num[] = new int[20],J,P=0,Q=0,sum=0,ave1=0,ave2;
for(J=0;J<20;J++)
{System.out.print("\nEnter the price: ");
num[J]=Integer.parseInt(x.readLine());
sum=num[J]+sum;
if (num[J]>20);
{P=num[J]+P;
ave1=P/num[J];}
if
(num[J]<20);
{Q=num[J]+Q;
ave2=Q/num[J];}
}System.out.print("\nThe sum of all 20 prices is "+sum);
System.out.print("\nThe sum of the prices higher than 5 is "+P);
System.out.print("\nThe average of the prices higher than 5 is "+ave1);
System.out.print("\nThe sum of all prices less than 5 is "+Q);
System.out.print("\nThe average of the prices less than 5 is "+Q);
}
}
\\ *Christian Abastillas DIT-113
import java.io.*;
public class ARRAYczA
{
public static void main(String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int num[] = new int[20],x,y=0,z=0,sum=0,averge1=0,averge2;
for(x=0;x<20;x++)
{System.out.print("\nEnter the price: ");
num[x]=Integer.parseInt(x.readLine());
sum=num[x]+sum;
if (num[x]>20);
{P=num[x]+y;
averge1=P/num[x];}
if
(num[x]<20);
{Q=num[x]+z;
averge2=Q/num[x];}
}System.out.print("\nThe sum of all 20 prices is "+sum);
System.out.print("\nThe sum of the prices higher than 5 is "+y);
System.out.print("\nThe average of the prices higher than 5 is "+averge1);
System.out.print("\nThe sum of all prices less than 5 is "+z);
System.out.print("\nThe average of the prices less than 5 is "+z);
}
}
//*DECEDA DIT113*//
import java.io.*;
public class ARRAYPZD
{
public static void main(String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int num[] = new int[20],Y,S=0,A=0,sum=0,averge1=0,averge2;
for(Y=0;Y<20;Y++)
{System.out.print("\nEnter the price: ");
num[Y]=Integer.parseInt(x.readLine());
sum=num[Y]+sum;
if (num[Y]>20);
{P=num[Y]+y;
averge1=S/num[Y];}
if
(num[Y]<20);
{Q=num[Y]+A;
averge2=A/num[Y];}
}System.out.print("\nThe sum of all 20 prices is "+sum);
System.out.print("\nThe sum of the prices higher than 5 is "+Z);
System.out.print("\nThe average of the prices higher than 5 is "+averge1);
System.out.print("\nThe sum of all prices less than 5 is "+A);
System.out.print("\nThe average of the prices less than 5 is "+A);
}
}
//* ANDRIAN CAPONPON DIT-113*//
import java.io.*;
public class ArrayABC
{
public static void main(String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int num[] = new int[20],A,B=0,C=0,sum=0,ave1=0,ave2;
for(A=0;A<20;A++)
{System.out.print("\nEnter the price: ");
num[A]=Integer.parseInt(x.readLine());
sum=num[A]+sum;
if (num[A]>20);
{P=num[A]+P;
ave1=P/num[A];}
if
(num[A]<20);
{C=num[A]+C;
ave2=C/num[A];}
}System.out.print("\nThe sum of all 20 prices is "+sum);
System.out.print("\nThe sum of the prices higher than 5 is "+B);
System.out.print("\nThe average of the prices higher than 5 is "+ave1);
System.out.print("\nThe sum of all prices less than 5 is "+C);
System.out.print("\nThe average of the prices less than 5 is "+C);
}
}
SNA Tma YN MaM....!!!!!
slamAt pou...!!!
import java.io.*;
public class BSCS112jkft
{
public static void main(String args[])throws IOException
{
BufferedReader jkft=new BufferedReader(new InputStreamReader(System.in));
int b[]=new int [10];
float jkft_average=0f;
int sum=1;
double sr= 2.9;
for (int i=0;i<10; i++)
{
System.out.print("\n Enter integer number " + "-->>");
b[i]=Integer.parseInt(jkft.readLine());
sum+=b[i];
jkft_average=sum/10;
}
if (jkft_average<75){
System.out.println("\nAverage is: " + jkft_average);
}
else if (jkft_average> 75 )
{
sr=Math.sqrt(jkft_average);
System.out.println("\n SquareRoot is: " + sr);
}
else
{
System.out.print("\n The sum is: " + sum);
}
}
}
import java.io.*;
public class BSIT112jkft
{
public static void main(String args[])throws IOException
{
BufferedReader jkft=new BufferedReader(new InputStreamReader(System.in));
int b[]=new int [10];
float jkft_average=0f;
int sum=1;
double sr= 2.9;
for (int i=0;i<10; i++)
{
System.out.print("\n Enter integer number " + "-->>");
b[i]=Integer.parseInt(jkft.readLine());
sum+=b[i];
jkft_average=sum/10;
}
if (jkft_average<75){
System.out.println("\nAverage is: " + jkft_average);
}
else if (jkft_average> 75 )
{
sr=Math.sqrt(jkft_average);
System.out.println("\n SquareRoot is: " + sr);
}
else
{
System.out.print("\n The sum is: " + sum);
}
}
}
import java.io.*;
public class BSIT112jkft
{
public static void main(String args[])throws IOException
{
BufferedReader jkft=new BufferedReader(new InputStreamReader(System.in));
int b[]=new int [10];
float jkft_average=0f;
int sum=1;
double sr= 2.9;
for (int i=0;i<10; i++)
{
System.out.print("\n Enter integer number " + "-->>");
b[i]=Integer.parseInt(jkft.readLine());
sum+=b[i];
jkft_average=sum/10;
}
if (jkft_average<75){
System.out.println("\nAverage is: " + jkft_average);
}
else if (jkft_average> 75 )
{
sr=Math.sqrt(jkft_average);
System.out.println("\n SquareRoot is: " + sr);
}
else
{
System.out.print("\n The sum is: " + sum);
}
}
}
JOY KRISTINE TABUNAN
Mark Anthony Flores
DIT 113
heheheh ang hirap ng sa DT 113 batet keya =(
(may galit keya si mam ??? hekhek
joke lang n_n)
eto na mam your wish is ok na hahehehehe
tagal ko ginawa yan :(
sakit sa head ahehheeh
==============================
//*Create a program that will accept 20 prices of an item and store it in an array. Compute and display the sum of all prices. Display all the values less that 5.00. Calculate and display the average of the prices, and display all values higher than the calculated average value. Class name is ArrayDIT113xxx
import java.io.*;
public class arraydit113mrf
{
public static void main(String args[])throws IOException
{
BufferedReader x=new BufferedReader(new InputStreamReader(System.in));
float sum=0,ave;
float num[]=new float[20];
String name;
System.out.print("Enter Item Name: ");
name=(x.readLine());
//*for input of 20 prices
for(int i=0;i<20;i++)
{System.out.print("Enter The Prices: ");
num[i]=Float.parseFloat(x.readLine());
sum = sum + num[i];}
System.out.print("\n\nThe Number Less Than 5.00 Are: ");
//*for distinguishing integers if its less than 5 to be display
for(int i=0;i<20;i++)
{
System.out.print("\n");//*for spacing
if( num [i] < 5.00)
System.out.print(" " +num[i]);
}
//*for averaging the prices
ave = sum/20;
System.out.print("\n\nThe Average of the Prices: "+ave);
System.out.print("\n\nThe Number Higher Than The Calculated Average Are: ");
//*for displaying all values higher than the calculated average value.
for(int i=0;i<20;i++)
{
System.out.print("\n");//*for spacing
if( num [i] > ave)
System.out.print(" " +num[i]);
}
}
}
==================================
mam tested yan tama na siguro yan hahahahah eheheheh though hindi ganun kaperfect aus yan ahehheheheheeh
=================================
See you next sem mam :)
=================================
Malalang sembreak na aheheheh
--------------------------------
JERALYN GARAY DIT211...MAAM I DID MY BEST AND I WANT TO LEARN MORE AND MORE TNXXX..
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class AppletDIT211()
public class AppletDIT211 extends JApplet implements ActionListener
{
Container con = getContentPane();
JLabel question = new JLabel("What’s your name?");
JTextField answer = new JTextField(10);
JButton press = new JButton("Press me");
public void init()
{
con.add(question);
con.add(answer);
con.add(press);
con.setLayout(new FlowLayout());
con.setnewfontsize("22");
JLabel label = new JLabel("Hello world!");
con.add(label);
press.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
String name = answer.getText();
JOptionPane.showMessageDialog(null, "You pressed the button, " + name);
}
}
}
import java.io.*;
public class ArrayBSCS112hjml
{
public static void main(String args[])throws IOException
{
BufferedReader in =new BufferedReader (new InputStreamReader (System.in));
String name=" ";
int a=0;
int b=0;
int c=0;
int d=0;
int e=0;
int x;
String name[] = new String [5];
for(name=0;name<5;name++)
{
System.out.print("The string is" + name);
name=(in.readLine());
}
int x;
x=txt.length();
for(b=0;x>b;b++)
if (txt.charAt(i)='a')
++vowels
else if (txt.charAt(i)='b)
++vowels
else if (txt.charAt(i)='c)
++vowels
else if (txt.charAt(i)='d)
++vowels
else if (txt.charAt(i='e)
++vowels
}
}
jobelle marie llanes
import java.io.*;
public class BSCS112jkft
{
public static void main(String args[])throws IOException
{
BufferedReader jkft=new BufferedReader(new InputStreamReader(System.in));
int b[]=new int [10];
float jkft_average=0f;
int sum=1;
double sr= 2.9;
for (int i=0;i<10; i++)
{
System.out.print("\n Enter integer number " + "-->>");
b[i]=Integer.parseInt(jkft.readLine());
sum+=b[i];
jkft_average=sum/10;
}
if (jkft_average<75){
System.out.println("\nAverage is: " + jkft_average);
}
else if (jkft_average> 75 )
{
sr=Math.sqrt(jkft_average);
System.out.println("\n SquareRoot is: " + sr);
}
else
{
System.out.print("\n The sum is: " + sum);
}
}
}
Regine Rose Ricamara
import java.io.*;
public class ArrayBSCS112jdp
{
public static void main(String args[])throws IOException
{
BufferedReader anzem = new BufferedReader (new InputStreamReader (System.in));
string name=" ";
int a=0;
int e=0;
int o=0;
int i=0;
int u=0;
int n;
string name[] = new string [5];
for(name=0;name<5;name++)
{
System.out.print("The string is" + name);
name=(anzem.readLine());
}
int n;
n=txt.length();
for(i=0;i < n;i++)
if (txt.charAt(i)='a')
++vowels
else if (txt.charAt(i)='e')
++vowels
else if (txt.charAt(i)='i')
++vowels
else if (txt.charAt(i)='o')
++vowels
else if (txt.charAt(i)='u')
++vowels
}
}
}
janine d. porte
Venus SunDIT211
ma'am, nd magfunction ung ibang size.... hehehehe......
kawawa ang magccopy paste...
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class AppletDIT211VAS extends Applet implements ActionListener {
Button btn1;
TextField txt1;
public void init()
{
setVisible(true);
setSize(290,250);
setLayout(null);
btn1=new Button("DISPLAY");
btn1.setBounds(15,140,90,40);
btn1.addActionListener(this);
add(btn1);
txt1=new TextField("");
txt1.setBounds(140,50,120,180);
Font a = new Font("arial",Font.BOLD,8);
txt1.setFont(a);
add(txt1);
}
public void actionPerformed(ActionEvent h)
{int w=4;
if(w<=4){
txt1.setText(txt1.getText());
Font k = new Font("arial",Font.BOLD,12);
txt1.setFont(k);
}
else if(w<=3){
txt1.setText(txt1.getText());
Font e = new Font("arial",Font.BOLD,16);
txt1.setFont(e);
}
else if(w<=2){
txt1.setText(txt1.getText());
Font q = new Font("arial",Font.BOLD,20);
txt1.setFont(q);
}
else if(w<=1){
txt1.setText(txt1.getText());
Font m = new Font("arial",Font.BOLD,24);
txt1.setFont(m);
}
else{
txt1.setText("");
btn1.setVisible(false);
}
}
}
Navarro R. Rofiles
DIT 113
import java.io.*;
public class ArrayDIT113NRR
{
public static void main(String args[]) throws IOException
{
BufferedReader NRR=new BufferedReader (new InputStreamReader(System.in));
int rOn[]=new int[20],a,e=0,n=0,sum=0,ave1=0,ave2;
for(a=0;a<20;a++)
{System.out.print("\n\nEnter The Price: ");
rOn[a]=Integer.parseInt(NRR.readLine());
sum=rOn[a]+sum;
if (rOn[a]>20);
{e=rOn[a]+e;
ave1=e/rOn[a];}
if
(rOn[a]<20);
{n=rOn[a]+n;
ave2=n/rOn[a];}
}System.out.print("\nThe sum of all 20 prices is "+sum);
System.out.print("\nThe Sum Of The Prices Higher Than 5 Is "+e);
System.out.print("\nThe Average Of The Prices Higher Than 5 Is "+ave1);
System.out.print("\nThe Sum Of All Prices Less Than 5 Is "+n);
System.out.print("\nThe Average Of The Prices Less Than 5 Is "+n);
}
}
_____sana po tama yan mam...._____
^_^
manilyn mendoza
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class sampleAppletRRA extends JApplet implements ActionListener
{
button btn;
textfield txt;
Container con = getContentPane();
JLabel question = new JLabel("What’s your name?");
JTextField answer = new JTextField(10);
JButton press = new JButton("Press me");
public void init()
{
btn=new
jbutton("click me");
btn.adDactionListener(yhis);
con.add(btn);
txt=new
jtextfield(15);
txt=setBounds(20;100,80,40); Font
lyn=setFont("timesnewroman,font.bold,8);
con.add(text);
}
public void actionPerformed(ActionEvent e)
{
objectSource();
if(source==btn)
font lyn=("timesnewroman",font.bold,24)
else
txt=new jtextfield("");
btn=setVisisble(false)';
public static void main(String args [])
appletdit211mbm=new
appletdit211mbm from setTitle("appletdit211mbm");
from.setSize(300,100);
from.setvisible(true);
}
}
}
jeralyn garay
2 to maam
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class applet extends JApplet implements ActionListener
{
button btn;
textfield txt;
Container con = getContentPane();
JLabel question = new JLabel("What’s your name?");
JTextField answer = new JTextField(10);
JButton press = new JButton("Press me");
public void init()
{
btn=new
jbutton("click me");
btn.adDactionListener(yhis);
con.add(btn);
txt=new
jtextfield(15);
txt=setBounds(20;100,80,40); Font
lyn=setFont("timesnewroman,font.bold,8);
con.add(text);
}
public void actionPerformed(ActionEvent e)
{
objectSource();
if(source==btn)
font lyn=("timesnewroman",font.bold,24)
else
txt=new jtextfield("");
btn=setVisisble(false)';
public static void main(String args [])
appletdit211mjhe=new
appletdit211jhe from setTitle("appletdit211jhe");
from.setSize(300,100);
from.setvisible(true);
}
}
}
import java.io.*;
public class arrayDIT112jcs
{
public static void main(String args[])throws IOException
{
BeffereReader x=new BufferedReader(new InputStreamReader(System.in));
int ar[]a;
ar=new int[5];
for( a=0;a<5;a++)
{
System.out.print("Enter number");
ar[a]=Integer.parseInt(x.readLine());
}
{
System.out.print("The inputted numbers are"+ar[a]);
}
for(a=0;a>5;a++)
{
System.out.print(The other inputted number are"+ar[a]);
}
}
}
JORALIE SANTAYANA DIT112
Myra Ver Rosales
DIT221
Create an applet with a Button labeled "Who's the greatest?" When the user clicks the button, display your name in a large font. Class name is AppletDIT221xxx.
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class DIT221MJR extends Applet implements ActionListener
{
Button b1;
Label lbl1;
public void init()
{
setVisible(true);
setSize(225,220);
setLayout(null);
setBackground(Color.black);
Font pogi = new Font("arial",Font.BOLD,40);
b1 = new Button("Who's the greatest?");
b1.setBounds(10,140,80,30);
b1.addActionListener(this);
b1.setForeground(Color.blue);
b1.setBackground(Color.black);
add(b1);
lbl1 = new Label("");
lbl1.setBounds(60,140,100,100);
lbl1.setForeground(Color.red);
lbl1.setFont(pogi);
add(lbl1);
}
public void actionPerformed(ActionEvent myra)
{
if(myra.getSource()==b1)
{
lbl1.setText("MYRA!!");
}
}
}
Kamlah Myrib Catangui
DIT221
Create an applet with a Button labeled "Who's the greatest?" When the user clicks the button, display your name in a large font. Class name is AppletDIT221xxx.
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class DIT221KMC extends Applet implements ActionListener
{
Button b1;
Label lbl1;
public void init()
{
setVisible(true);
setSize(225,220);
setLayout(null);
setBackground(Color.black);
Font ganda = new Font("arial",Font.BOLD,40);
b1 = new Button("Who's the greatest?");
b1.setBounds(10,140,80,30);
b1.addActionListener(this);
b1.setForeground(Color.blue);
b1.setBackground(Color.black);
add(b1);
lbl1 = new Label("");
lbl1.setBounds(60,140,100,100);
lbl1.setForeground(Color.red);
lbl1.setFont(ganda);
add(lbl1);
}
public void actionPerformed(ActionEvent kamlah)
{
if(kamlah.getSource()==b1)
{
lbl1.setText("KAMLAH!!");
}
}
}
/*
Create a program that will accept 20 prices of an item and store it in an array. Compute and
display the sum of all prices. Display all the values less that 5.00. Calculate and display
the average of the prices, and display all values higher than the calculated average value.
Class name is ArrayDIT113xxx.*/
import java.io.*;
public class ArrayDIT113jcs
{
public static void main (String args[])throws IOException
{
for(a=0;a<20;a++)
{
BufferedReader x=new BufferedReader (new InputStreamReader(System.in));
int a,b=0,c=0,s=0,ave1=0,ave2=0;
int num[]=new int[20];
for(a=0;a<5;a++)
{
System.out.print("Enter item price:");
a=Integer.parseInt(x.readLine());
s=s+price[a];
}
if (num[a]<20)
{
b=a+b;
ave1 =less/num[a];
}
else if(num[a]>20)
{
c=num[a] +high;
ave2 =high/num[a];
}
}
System.out.println("The sum of the 20 prices is " +sum);
System.out.println("The sum of the prices Less Than 5 is : " +less);
System.out.println("the average of the prices less than 5 is : " +ave1);
System.out.println("the sum of all prices higher than 5 is : " +high);
System.out.println("The average of all prices higher than 5 is : " +ave2);
}
}
mam ito po sagot ko julius salcedo po ito. DIT 113 e2 na po mam yung sagot ko na ipost ko na
import java.io.*;
public class ArrayDIT113gfm
{
public static void main(String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader(System.in));
int g;
int a [] = new int[20];
for ( g=0; g<20; g++)
{
System.out.print ("Enter number ");
a[g] = Integer.parseInt(x.readLine());
}
System.out.print("\n\n The sum are \n");
for(g=0; g<10; g++)
{
System.out.println("" + a[g]);
}
}
}
gabriel magno DIT113
//*Jerico Arenas*//
import java.io.*;
public class ArrayDIT113arenas
{
public static void main(String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int jerico[] = new int[20],a,sum=0,ave1=0,b=0,c=0,ave2;
for(a=0;a<20;a++)
{
System.out.print("\n\nEnter price: ");
jerico[a]=Integer.parseInt(x.readLine());
sum= jerico[a]+sum;
if (jerico[a]>20);
{ b= jerico[a]+b;
ave1=b/ jerico[a]; }
if
(jerico[a]<20);
{ c= jerico[a]+c;
ave2=c/jerico[a]; }
}System.out.print("\nThe sum of all 20 prices is "+sum);
System.out.print("\nThe sum of the prices higher than 5 is "+b);
System.out.print("\nThe ave of the prices higher than 5 is "+ave1);
System.out.print("\nThe sum of all prices less than 5 is "+c);
System.out.print("\nThe ave of the prices less than 5 is "+c);
}
}
SALCEDO, JULIUS DIT113
import java.io.*;
public class ArrayDIT113jcs
{
public static void main(String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int a,b,c,sum,ave1,ave2;
int num[]=new int[20];
b = 0;
c = 0;
sum = 0;
ave1 = 0;
ave2 = 0;
for(a=0;a<20;a++)
{
System.out.print("Enter price: ");
num[a] = Integer.parseInt(x.readLine());
sum=num[a]+sum;
if (num[a]<5)
{
b = num[a] + b;
ave1 = b/num[a];
}
else if(num[a]>5)
{
c = num[a] + c;
ave2 = c/num[a];
}
}
System.out.println("The sum of the 20 prices entered is " +sum);
System.out.println("The sum of the prices Less Than 5 is : " +b);
System.out.println("the sum of all prices higher than 5 is : " +c);
System.out.println("the average of the prices less than 5 is : " +ave1);
System.out.println("The average of all prices higher than 5 is : " +ave2);
}
}
Problem:
Create an applet that asks a user to enter a password into a TextField and then press the enter key. Compare the password to "Rosebud"; if they match, display "Access Granted"; if not, display "Access Denied". Class name is AppletBSCS221xxx.
Code:
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class AppletBSCS211JGMM extends JApplet implements ActionListener
{
Container JGMM = getContentPane();
JLabel password = new JLabel("What’s the password?");
JTextField input = new JTextField(10);
JButton enter = new JButton("Enter");
public void init()
{
JGMM.add(password);
JGMM.add(input);
JGMM.add(enter);
JGMM.setLayout(new FlowLayout());
enter.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
String pass1 = input.getText();
String pass2 = "Rosebud";
if(pass1==pass2)
{
JOptionPane.showMessageDialog(null, "Access Granted!");
}
else
{
JOptionPane.showMessageDialog(null, "Access Denied!");
}
}
}
Waah wait lang mam.. dami ko pa error.. >< huhu
/*Create a program that will accept 20 prices of an item and store it in an array.
*Compute and display the sum of all prices. Display all the values less than 5.00.
*Calculate and display the average of the prices, and display all values higher than the calculated average value.
*Class name is ArrayDIT113xxx.*/
import java.io.*;
public class ArrayDIT113ASM
{
public static void main(String args []) throws IOException
{
BufferedReader x = new BufferedReader ( new InputStreamReader(System.in));
float[] price = new float[20];
System.out.println("Please Input the pices");
for(int r = 0; r<20;r++){
System.out.print("Item no. "+ (r+1) +" = ");
price[r] = Float.parseFloat(x.readLine());
}
float sum = 0;
for( int y = 0 ; y <20 ;y++){
sum += price[y];
}
System.out.println("\nThe sum is " + sum );
System.out.println("\nThese are the item that the price is less than 5.0 ");
for( int y = 0 ; y <20 ;y++){
if(price[y]<5.0){
System.out.println("Item no. "+ (y+1) +" = " + price[y]);
}
}
float ave = (sum / price.length );
System.out.println("\nThe average price is "+ ave);
System.out.println("\nThese are the item that the price is greater than average price.");
for( int y = 0 ; y <20 ;y++){
if(price[y]>ave){
System.out.println("Item no. "+ (y+1) +" = " + price[y]);
}
}
}
}
/*Hayz natapos ko na poh mam..
*Tulog na poh ako nyt nyt!
*Alvin Morales poh DIT-1/1-3*/
grabe mam, iba talaga pag written at pag hands on naman na programming makakaya pa.. hehe nakakahinga pa naman mam... Sleep na po ako bye bye!! ^^
Tyson Anlacan
BSCoE 411
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class AppletBSCOE411TMA extends Applet implements ActionListener{
Button comp;
Label lbhr, lblrate, lblgp, lblwt, lblnp;
TextField txthr, txtrate, txtgp, txtwt, txtnp;
public static void main(String args[]){
AppletBSCOE411TMA s=new AppletBSCOE411TMA ();
s.addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent a)
{System.exit(0);}});
}
AppletBSCOE411TMA(){
setVisible(true);
setTitle("Loop");
setSize(260,500);
setLayout(null);
setResizable(false);
setBackground(Color.black);
lbhr=new Label("Hours worked: ");
lbhr.setBounds(20,50,130,30);
lbhr.setBackground(Color.black);
lbhr.setForeground(Color.green);
add(lbhr);
lblrate= new Label("Hourly Rate:");
lblrate.setBounds(20,100,110,30);
lblrate.setBackground(Color.black);
lblrate.setForeground(Color.green);
add(lblrate);
lblgp= new Label("Gross pay:");
lblgp.setBounds(90,150,110,120);
lblgp.setBackground(Color.black);
lblgp.setForeground(Color.green);
add(lblgp);
lblwt= new Label("Withholding Tax:");
lblwt.setBounds(90,200,110,120);
lblwt.setBackground(Color.black);
lblwt.setForeground(Color.green);
add(lblwt);
lblnp= new Label("Net Pay:");
lblnp.setBounds(90,250,110,120);
lblnp.setBackground(Color.black);
lblnp.setForeground(Color.green);
add(lblnp);
txthr=new TextField("");
txthr.setBounds(160,50,80,30);
add(txthr);
txtrate=new TextField("");
txtrate.setBounds(160,100,80,30);
add(txtrate);
txtgp=new TextField("");
txtgp.setBounds(160,150,80,30);
add(txtgp);
txtwt=new TextField("");
txtwt.setBounds(160,200,80,30);
add(txtwt);
txtnp=new TextField("");
txtnp.setBounds(160,250,80,30);
add(txtnp);
comp=new Button("COMPUTE");
comp.setBounds(90,300,80,30);
add(comp);
comp.addActionListener(this);
}
public void actionPerformed(ActionEvent sm){
int hr, rate;
float gp, wt, np;
hr=Integer.parseInt(txthr.getText());
rate=Integer.parseInt(txtrate.getText());
gp=Float.parseFloat(txtgp.getText());
wt=Float.parseFloat(txtwt.getText());
np=Float.parseFloat(txtnp.getText());
if(sm.getSource()==comp{
gp = hr * rate;
txtgp.setText("" +gp);
if(gp <= 99.99)
{
wt = gp * (float)0.1;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 299.99)
{
wt = gp * (float)0.15;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 599.99)
{
wt = gp * (float)0.21;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 600)
{
wt = gp * (float)0.28;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
}
}
Jay-Jaber Ramirez
BSCoE 411
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class AppletBSCOE411TMA extends Applet implements ActionListener{
Button comp;
Label lbhr, lblrate, lblgp, lblwt, lblnp;
TextField txthr, txtrate, txtgp, txtwt, txtnp;
public static void main(String args[]){
AppletBSCOE411TMA s=new AppletBSCOE411TMA ();
s.addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent a)
{System.exit(0);}});
}
AppletBSCOE411TMA(){
setVisible(true);
setTitle("Loop");
setSize(260,500);
setLayout(null);
setResizable(false);
setBackground(Color.black);
lbhr=new Label("Hours worked: ");
lbhr.setBounds(20,50,130,30);
lbhr.setBackground(Color.black);
lbhr.setForeground(Color.green);
add(lbhr);
lblrate= new Label("Hourly Rate:");
lblrate.setBounds(20,100,110,30);
lblrate.setBackground(Color.black);
lblrate.setForeground(Color.green);
add(lblrate);
lblgp= new Label("Gross pay:");
lblgp.setBounds(90,150,110,120);
lblgp.setBackground(Color.black);
lblgp.setForeground(Color.green);
add(lblgp);
lblwt= new Label("Withholding Tax:");
lblwt.setBounds(90,200,110,120);
lblwt.setBackground(Color.black);
lblwt.setForeground(Color.green);
add(lblwt);
lblnp= new Label("Net Pay:");
lblnp.setBounds(90,250,110,120);
lblnp.setBackground(Color.black);
lblnp.setForeground(Color.green);
add(lblnp);
txthr=new TextField("");
txthr.setBounds(160,50,80,30);
add(txthr);
txtrate=new TextField("");
txtrate.setBounds(160,100,80,30);
add(txtrate);
txtgp=new TextField("");
txtgp.setBounds(160,150,80,30);
add(txtgp);
txtwt=new TextField("");
txtwt.setBounds(160,200,80,30);
add(txtwt);
txtnp=new TextField("");
txtnp.setBounds(160,250,80,30);
add(txtnp);
comp=new Button("COMPUTE");
comp.setBounds(90,300,80,30);
add(comp);
comp.addActionListener(this);
}
public void actionPerformed(ActionEvent sm){
int hr, rate;
float gp, wt, np;
hr=Integer.parseInt(txthr.getText());
rate=Integer.parseInt(txtrate.getText());
gp=Float.parseFloat(txtgp.getText());
wt=Float.parseFloat(txtwt.getText());
np=Float.parseFloat(txtnp.getText());
if(sm.getSource()==comp{
gp = hr * rate;
txtgp.setText("" +gp);
if(gp <= 99.99)
{
wt = gp * (float)0.1;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 299.99)
{
wt = gp * (float)0.15;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 599.99)
{
wt = gp * (float)0.21;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 600)
{
wt = gp * (float)0.28;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
}
}
import java.io.*;
public class ArrayDIT111JAB
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],b=0,c=0,d;
for(b=0;b<20;b++)
{
System.out.print("\nEnter Number "+(b+1)+": ");
a[b]=Integer.parseInt(x.readLine());
}
System.out.print("\nThe Even Numbers are: \n");
for(b=0;b<20;b++)
{
d=a[b]%2;
if (d==0)
{
System.out.print("\n"+a[b]);
}
}
System.out.print("\n\nThe 1st Number is: "+a[0]);
System.out.println("\n\nThe Last Number is: "+a[19]);
}
import java.io.*;
public class ArrayDIT111JAB
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],b=0,c=0,d;
for(b=0;b<40;b++)
{
System.out.print("\nEnter Number "+(b+1)+": ");
a[b]=Integer.parseInt(x.readLine());
}
System.out.print("\nThe Even Numbers are: \n");
for(b=0;b<20;b++)
{
d=a[b]%2;
if (d==0)
{
System.out.print("\n"+a[b]);
}
}
System.out.print("\n\nThe 1st Number is: "+a[0]);
System.out.println("\n\nThe Last Number is: "+a[19]);
}
}
import java.io.*;
public class ArrayDIT111JAB
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader (System.in));
int a[] = new int[20],b=0,c=0,d;
for(b=0;b<40;b++)
{
System.out.print("\nEnter Number "+(b+1)+": ");
a[b]=Integer.parseInt(x.readLine());
}
System.out.print("\nThe Even Numbers are: \n");
for(b=0;b<20;b++)
{
d=a[b]%2;
if (d==0)
{
System.out.print("\n"+a[b]);
}
}
System.out.print("\n\nThe 1st Number is: "+a[0]);
System.out.println("\n\nThe Last Number is: "+a[19]);
}
}
GORIOBOi -- BATARIO
Jeyfren Manalo
BSCoE 4-1-1
COMPRO3
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class AppletBSCOE411JPM extends Applet implements ActionListener{
Button comp;
Label lbhr, lblrate, lblgp, lblwt, lblnp;
TextField txthr, txtrate, txtgp, txtwt, txtnp;
public static void main(String args[]){
AppletBSCOE411JPM s=new AppletBSCOE411JPM ();
s.addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent a)
{System.exit(0);}});
}
AppletBSCOE411JPM(){
setVisible(true);
setTitle("Loop");
setSize(260,500);
setLayout(null);
setResizable(false);
setBackground(Color.black);
lbhr=new Label("Hours worked: ");
lbhr.setBounds(20,50,130,30);
lbhr.setBackground(Color.black);
lbhr.setForeground(Color.green);
add(lbhr);
lblrate= new Label("Hourly Rate:");
lblrate.setBounds(20,100,110,30);
lblrate.setBackground(Color.black);
lblrate.setForeground(Color.green);
add(lblrate);
lblgp= new Label("Gross pay:");
lblgp.setBounds(90,150,110,120);
lblgp.setBackground(Color.black);
lblgp.setForeground(Color.green);
add(lblgp);
lblwt= new Label("Withholding Tax:");
lblwt.setBounds(90,200,110,120);
lblwt.setBackground(Color.black);
lblwt.setForeground(Color.green);
add(lblwt);
lblnp= new Label("Net Pay:");
lblnp.setBounds(90,250,110,120);
lblnp.setBackground(Color.black);
lblnp.setForeground(Color.green);
add(lblnp);
txthr=new TextField("");
txthr.setBounds(160,50,80,30);
add(txthr);
txtrate=new TextField("");
txtrate.setBounds(160,100,80,30);
add(txtrate);
txtgp=new TextField("");
txtgp.setBounds(160,150,80,30);
add(txtgp);
txtwt=new TextField("");
txtwt.setBounds(160,200,80,30);
add(txtwt);
txtnp=new TextField("");
txtnp.setBounds(160,250,80,30);
add(txtnp);
comp=new Button("COMPUTE");
comp.setBounds(90,300,80,30);
add(comp);
comp.addActionListener(this);
}
public void actionPerformed(ActionEvent j){
int hr, rate;
float gp, wt, np;
hr=Integer.parseInt(txthr.getText());
rate=Integer.parseInt(txtrate.getText());
gp=Float.parseFloat(txtgp.getText());
wt=Float.parseFloat(txtwt.getText());
np=Float.parseFloat(txtnp.getText());
if(j.getSource()==comp{
gp = hr * rate;
txtgp.setText("" +gp);
if(gp <= 99.99)
{
wt = gp * (float)0.1;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 299.99)
{
wt = gp * (float)0.15;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 599.99)
{
wt = gp * (float)0.21;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 600)
{
wt = gp * (float)0.28;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
}
}
Benedict G. Peñaflor
BSCoE 4-1-1
COMPRO3
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class AppletBSCOE411BGP extends Applet implements ActionListener{
Button comp;
Label lbhr, lblrate, lblgp, lblwt, lblnp;
TextField txthr, txtrate, txtgp, txtwt, txtnp;
public static void main(String args[]){
AppletBSCOE411BGP s=new AppletBSCOE411BGP ();
s.addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent a)
{System.exit(0);}});
}
AppletBSCOE411BGP(){
setVisible(true);
setTitle("Loop");
setSize(260,500);
setLayout(null);
setResizable(false);
setBackground(Color.black);
lbhr=new Label("Hours worked: ");
lbhr.setBounds(20,50,130,30);
lbhr.setBackground(Color.black);
lbhr.setForeground(Color.green);
add(lbhr);
lblrate= new Label("Hourly Rate:");
lblrate.setBounds(20,100,110,30);
lblrate.setBackground(Color.black);
lblrate.setForeground(Color.green);
add(lblrate);
lblgp= new Label("Gross pay:");
lblgp.setBounds(90,150,110,120);
lblgp.setBackground(Color.black);
lblgp.setForeground(Color.green);
add(lblgp);
lblwt= new Label("Withholding Tax:");
lblwt.setBounds(90,200,110,120);
lblwt.setBackground(Color.black);
lblwt.setForeground(Color.green);
add(lblwt);
lblnp= new Label("Net Pay:");
lblnp.setBounds(90,250,110,120);
lblnp.setBackground(Color.black);
lblnp.setForeground(Color.green);
add(lblnp);
txthr=new TextField("");
txthr.setBounds(160,50,80,30);
add(txthr);
txtrate=new TextField("");
txtrate.setBounds(160,100,80,30);
add(txtrate);
txtgp=new TextField("");
txtgp.setBounds(160,150,80,30);
add(txtgp);
txtwt=new TextField("");
txtwt.setBounds(160,200,80,30);
add(txtwt);
txtnp=new TextField("");
txtnp.setBounds(160,250,80,30);
add(txtnp);
comp=new Button("COMPUTE");
comp.setBounds(90,300,80,30);
add(comp);
comp.addActionListener(this);
}
public void actionPerformed(ActionEvent b){
int hr, rate;
float gp, wt, np;
hr=Integer.parseInt(txthr.getText());
rate=Integer.parseInt(txtrate.getText());
gp=Float.parseFloat(txtgp.getText());
wt=Float.parseFloat(txtwt.getText());
np=Float.parseFloat(txtnp.getText());
if(b.getSource()==comp{
gp = hr * rate;
txtgp.setText("" +gp);
if(gp <= 99.99)
{
wt = gp * (float)0.1;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 299.99)
{
wt = gp * (float)0.15;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 599.99)
{
wt = gp * (float)0.21;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
else if(gp >= 600)
{
wt = gp * (float)0.28;
np = gp - wt;
txtwt.setText("" + wt);
txtnp.setText("" + np);
}
}
}
Mayra Lloveras
DIT
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.applet.*;
public class quizmml extends Applet implements ActionListener
{
Button b1,b2,b3,b4,b5,b6;
Label l1,l2;
TextField t1;
public void init()
{
setVisible(true);
setSize(300,200);
setLayout(null);
setBackground(Color.black);
b1 = new Button("Enter");
b1.setBounds(200,50,60,20);
b1.setForeground(Color.red);
b1.addActionListener(this);
add(b1);
b2 = new Button("Enter");
b2.setBounds(200,50,60,20);
b2.setForeground(Color.red);
b2.addActionListener(this);
b2.setVisible(false);
add(b2);
b3 = new Button("Enter");
b3.setBounds(200,50,60,20);
b3.setForeground(Color.red);
b3.addActionListener(this);
b3.setVisible(false);
add(b3);
b4 = new Button("Enter");
b4.setBounds(200,50,60,20);
b4.setForeground(Color.red);
b4.addActionListener(this);
b4.setVisible(false);
add(b4);
b5 = new Button("Enter");
b5.setBounds(200,50,60,20);
b5.setForeground(Color.red);
b5.addActionListener(this);
b5.setVisible(false);
add(b5);
b6 = new Button("Enter");
b6.setBounds(200,50,60,20);
b6.setForeground(Color.red);
b6.addActionListener(this);
b6.setVisible(false);
add(b6);
t1=new TextField("");
t1.setBounds(30,50,150,20);
add(t1);
l2 = new Label("you have gone over the font size limit!");
l2.setBounds(10,140,500,40);
l2.setForeground(Color.blue);
Font qw=new Font("arial",Font.BOLD,15);
l2.setFont(qw);
l2.setVisible(false);
add(l2);
l1=new Label("");
l1.setBounds(120,100,120,30);
l1.setForeground(Color.red);
Font a=new Font("arial",Font.ITALIC,8);
l1.setFont(a);
add(l1);
}
public void actionPerformed(ActionEvent mayra)
{
if(mayra.getSource()==b1)
{
Font m = new Font("arial",Font.BOLD,8);
l1.setText(t1.getText());
l1.setFont(m);
b1.setVisible(false);
b2.setVisible(true);
}
if(mayra.getSource()==b2)
{
Font n = new Font("arial",Font.BOLD,12);
l1.setText(t1.getText());
l1.setFont(n);
b2.setVisible(false);
b3.setVisible(true);
}
if(mayra.getSource()==b3)
{
Font o = new Font("arial",Font.BOLD,16);
l1.setText(t1.getText());
l1.setFont(o);
b3.setVisible(false);
b4.setVisible(true);
}
if(mayra.getSource()==b4)
{
Font p = new Font("arial",Font.BOLD,20);
l1.setText(t1.getText());
l1.setFont(p);
b4.setVisible(false);
b5.setVisible(true);
}
if(mayra.getSource()==b5)
{
Font p = new Font("arial",Font.BOLD,24);
l1.setText(t1.getText());
l1.setFont(p);
b5.setVisible(false);
b6.setVisible(true);
}
if(mayra.getSource()==b6)
{
l2.setVisible(true);
b6.setEnabled(false);
}
}
}
MAYRA LLOVERAS
DIT 2-1-1
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.applet.*;
public class quizmml extends Applet implements ActionListener
{
Button b1,b2,b3,b4,b5,b6;
Label l1,l2;
TextField t1;
public void init()
{
setVisible(true);
setSize(300,200);
setLayout(null);
setBackground(Color.black);
b1 = new Button("Enter");
b1.setBounds(200,50,60,20);
b1.setForeground(Color.red);
b1.addActionListener(this);
add(b1);
b2 = new Button("Enter");
b2.setBounds(200,50,60,20);
b2.setForeground(Color.red);
b2.addActionListener(this);
b2.setVisible(false);
add(b2);
b3 = new Button("Enter");
b3.setBounds(200,50,60,20);
b3.setForeground(Color.red);
b3.addActionListener(this);
b3.setVisible(false);
add(b3);
b4 = new Button("Enter");
b4.setBounds(200,50,60,20);
b4.setForeground(Color.red);
b4.addActionListener(this);
b4.setVisible(false);
add(b4);
b5 = new Button("Enter");
b5.setBounds(200,50,60,20);
b5.setForeground(Color.red);
b5.addActionListener(this);
b5.setVisible(false);
add(b5);
b6 = new Button("Enter");
b6.setBounds(200,50,60,20);
b6.setForeground(Color.red);
b6.addActionListener(this);
b6.setVisible(false);
add(b6);
t1=new TextField("");
t1.setBounds(30,50,150,20);
add(t1);
l2 = new Label("you have gone over the font size limit!");
l2.setBounds(10,140,500,40);
l2.setForeground(Color.blue);
Font qw=new Font("arial",Font.BOLD,15);
l2.setFont(qw);
l2.setVisible(false);
add(l2);
l1=new Label("");
l1.setBounds(120,100,120,30);
l1.setForeground(Color.red);
Font a=new Font("arial",Font.ITALIC,8);
l1.setFont(a);
add(l1);
}
public void actionPerformed(ActionEvent mayra)
{
if(mayra.getSource()==b1)
{
Font m = new Font("arial",Font.BOLD,8);
l1.setText(t1.getText());
l1.setFont(m);
b1.setVisible(false);
b2.setVisible(true);
}
if(mayra.getSource()==b2)
{
Font n = new Font("arial",Font.BOLD,12);
l1.setText(t1.getText());
l1.setFont(n);
b2.setVisible(false);
b3.setVisible(true);
}
if(mayra.getSource()==b3)
{
Font o = new Font("arial",Font.BOLD,16);
l1.setText(t1.getText());
l1.setFont(o);
b3.setVisible(false);
b4.setVisible(true);
}
if(mayra.getSource()==b4)
{
Font p = new Font("arial",Font.BOLD,20);
l1.setText(t1.getText());
l1.setFont(p);
b4.setVisible(false);
b5.setVisible(true);
}
if(mayra.getSource()==b5)
{
Font p = new Font("arial",Font.BOLD,24);
l1.setText(t1.getText());
l1.setFont(p);
b5.setVisible(false);
b6.setVisible(true);
}
if(mayra.getSource()==b6)
{
l2.setVisible(true);
b6.setEnabled(false);
}
}
}
NADINE CRISTINE ANN E. GARCIA
DIT 2-1-1import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.applet.*;
public class FQUIZZNCA extends Applet implements ActionListener
{
Button b1,b2,b3,b4,b5,b6;
Label l1,l2;
TextField t1;
public void init()
{
setVisible(true);
setSize(300,200);
setLayout(null);
setBackground(Color.black);
b1 = new Button("Enter");
b1.setBounds(200,50,60,20);
b1.setForeground(Color.red);
b1.addActionListener(this);
add(b1);
b2 = new Button("Enter");
b2.setBounds(200,50,60,20);
b2.setForeground(Color.red);
b2.addActionListener(this);
b2.setVisible(false);
add(b2);
b3 = new Button("Enter");
b3.setBounds(200,50,60,20);
b3.setForeground(Color.red);
b3.addActionListener(this);
b3.setVisible(false);
add(b3);
b4 = new Button("Enter");
b4.setBounds(200,50,60,20);
b4.setForeground(Color.red);
b4.addActionListener(this);
b4.setVisible(false);
add(b4);
b5 = new Button("Enter");
b5.setBounds(200,50,60,20);
b5.setForeground(Color.red);
b5.addActionListener(this);
b5.setVisible(false);
add(b5);
b6 = new Button("Enter");
b6.setBounds(200,50,60,20);
b6.setForeground(Color.red);
b6.addActionListener(this);
b6.setVisible(false);
add(b6);
t1=new TextField("");
t1.setBounds(30,50,150,20);
add(t1);
l2 = new Label("you have gone over the font size limit!");
l2.setBounds(10,140,500,40);
l2.setForeground(Color.blue);
Font qw=new Font("arial",Font.BOLD,15);
l2.setFont(qw);
l2.setVisible(false);
add(l2);
l1=new Label("");
l1.setBounds(120,100,120,30);
l1.setForeground(Color.red);
Font a=new Font("arial",Font.ITALIC,8);
l1.setFont(a);
add(l1);
}
public void actionPerformed(ActionEvent NADZ)
{
if(NADZ.getSource()==b1)
{
Font m = new Font("arial",Font.BOLD,8);
l1.setText(t1.getText());
l1.setFont(m);
b1.setVisible(false);
b2.setVisible(true);
}
if(NADZ.getSource()==b2)
{
Font n = new Font("arial",Font.BOLD,12);
l1.setText(t1.getText());
l1.setFont(n);
b2.setVisible(false);
b3.setVisible(true);
}
if(NADZ.getSource()==b3)
{
Font o = new Font("arial",Font.BOLD,16);
l1.setText(t1.getText());
l1.setFont(o);
b3.setVisible(false);
b4.setVisible(true);
}
if(NADZ.getSource()==b4)
{
Font p = new Font("arial",Font.BOLD,20);
l1.setText(t1.getText());
l1.setFont(p);
b4.setVisible(false);
b5.setVisible(true);
}
if(NADZ.getSource()==b5)
{
Font p = new Font("arial",Font.BOLD,24);
l1.setText(t1.getText());
l1.setFont(p);
b5.setVisible(false);
b6.setVisible(true);
}
if(NADZ.getSource()==b6)
{
l2.setVisible(true);
b6.setEnabled(false);
}
}
}
Create an applet with a Button labeled "Who's the greatest?" When the user clicks the button, display your name in a large font. Class name is AppletDIT221xxx.
-------------------------------------
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.awt.*;
public class DIT221CAM extends Applet implements ActionListener
{
Label label1;
Button button1;
public void init()
{
setSize(1000,1000);
setVisible(true);
setLayout(null);
setBackground(Color.green);
Font abc = new Font("arial",Font.BOLD,50);
button1 = new Button("Who's the greatest?");
button1.setBounds(375,150,250,50);
button1.setForeground(Color.blue);
button1.setBackground(Color.yellow);
button1.addActionListener(this);
add(button1);
label1 = new Label("");
label1.setBounds(245,220,600,100);
label1.setForeground(Color.blue);
label1.setFont(abc);
add(label1);
}
public void actionPerformed(ActionEvent hello)
{
if(hello.getSource()==button1)
{label1.setText("CLAY ANN E. MEJIDA");}
}
}
mam ito poh project koh
red
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class sampleAppletRRA extends JApplet implements ActionListener
{
button btn;
textfield txt;
Container con = getContentPane();
JLabel question = new JLabel("What’s your name?");
JTextField answer = new JTextField(10);
JButton press = new JButton("Press me");
public void init()
{
btn = new
rbutton("press")
btn.addActionListener(this);
con.add(btn);
txt=new
rtextfield(10);
txt=setBounds(15;50;40;80);
con.add(text);
}
public void actionPerformed(ActionEvent e)
{
objectSource();
if (source==btn)
font line=("monotype corsovia",font. italic.20)
else
txt=new rtextfield("");
btn=setVisible(false);
public static void mais (Srting args[])
appletDIT211red=new
appletDIT211red from setTitle("appletDIT211red")
fromsetSize(100,50);
from setVisible(true);
}
}
}
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class applet extends JApplet implements ActionListener
{
button btn;
textfield txt;
Container con = getContentPane();
JLabel question = new JLabel("What’s your name?");
JTextField answer = new JTextField(10);
JButton press = new JButton("Press me");
public void int()
{
btn=new
jbutton("click me");
btn.adDactionListener(yhis);
con.add(btn);
txt=new
jtextfield(15);
txt=setBounds(20;100,80,40); Font
lyn=setFont("timesnewroman,font.bold,8);
con.add(text);
}
public void actionPerformed(ActionEvent e)
{
objectSource();
if(source==btn)
font lyn=("timesnewroman",font.bold,24)
else
txt=new jtextfield("");
btn=setVisisble(false)';
public static void main(String args [])
appletdit211mjhe=new
appletdit211jhe from setTitle("appletdit211job");
from.setSize(300,100);
from.setvisible(true);
}
}
}
jenalyn bobadilla
dit 211
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class applet extends JApplet implements ActionListener
{
button btn;
textfield txt;
Container con = getContentPane();
JLabel question = new JLabel("What’s your name?");
JTextField answer = new JTextField(10);
JButton press = new JButton("Press me");
public void int()
{
btn=new
jbutton("click me");
btn.adDactionListener(yhis);
con.add(btn);
txt=new
jtextfield(15);
txt=setBounds(20;100,80,40); Font
lyn=setFont("timesnewroman,font.bold,8);
con.add(text);
}
public void actionPerformed(ActionEvent e)
{
objectSource();
if(source==btn)
font lyn=("timesnewroman",font.bold,24)
else
txt=new jtextfield("");
btn=setVisisble(false)';
public static void main(String args [])
appletdit211mjhe=new
appletdit211jhe from setTitle("appletdit211job");
from.setSize(300,100);
from.setvisible(true);
}
}
}
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class AppletDIT211mov extends Applet implements ActionListener
{
Button btn1;
TextField txt1;
public void init()
{
setVisible(true);
setSize(250,200);
setLayout(null);
btn1=new Button("DISPLAY");
btn1.setBounds(15,140,90,40);
btn1.addActionListener(this);
add(btn1);
txt1=new TextField("");
txt1.setBounds(140,50,120,180);
Font a = new Font("arial",Font.BOLD,8);
txt1.setFont(a);
add(txt1);
}
public void actionPerformed(ActionEvent h)
{
int w=4;
if(w<=4){
txt1.setText(txt1.getText());
Font k = new Font("arial",Font.BOLD,12);
txt1.setFont(k);
}
else if(w<=3){
txt1.setText(txt1.getText());
Font e = new Font("arial",Font.BOLD,16);
txt1.setFont(e);
}
else if(w<=2){
txt1.setText(txt1.getText());
Font q = new Font("arial",Font.BOLD,20);
txt1.setFont(q);
}
else if(w<=1){
txt1.setText(txt1.getText());
Font m = new Font("arial",Font.BOLD,24);
txt1.setFont(m);
}
else{
txt1.setText("");
btn1.setVisible(false);
}
}
}
mariecres vilela
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class AppletDIT211mov extends Applet implements ActionListener
{
Button btn1;
TextField txt1;
public void init()
{
setVisible(true);
setSize(250,200);
setLayout(null);
btn1=new Button("DISPLAY");
btn1.setBounds(15,140,90,40);
btn1.addActionListener(this);
add(btn1);
txt1=new TextField("");
txt1.setBounds(140,50,120,180);
Font a = new Font("arial",Font.BOLD,8);
txt1.setFont(a);
add(txt1);
}
public void actionPerformed(ActionEvent h)
{
int w=4;
if(w<=4){
txt1.setText(txt1.getText());
Font k = new Font("arial",Font.BOLD,12);
txt1.setFont(k);
}
else if(w<=3){
txt1.setText(txt1.getText());
Font e = new Font("arial",Font.BOLD,16);
txt1.setFont(e);
}
else if(w<=2){
txt1.setText(txt1.getText());
Font q = new Font("arial",Font.BOLD,20);
txt1.setFont(q);
}
else if(w<=1){
txt1.setText(txt1.getText());
Font m = new Font("arial",Font.BOLD,24);
txt1.setFont(m);
}
else{
txt1.setText("");
btn1.setVisible(false);
}
}
import java.io.*;
public class DITkaq
{
public static void main (String args[]) throws IOException
{
BufferedReader x=new BufferedReader (new InputStreamReader(System.in));
int a[] = new int[20],b=0;
for (b=0;b<20;b++)
{
System.out.print ("\n Enter a number "+(b+1)+": ");
a[b]=Integer.parseInt(x.readLine());
}
System.out.print ("\n The inputted numbers are: \n");
for(b=0;b<20;b++)
{
System.out.print ("\n\t\t" +a[b]);
}
System.out.print ("\n\nThis the first number you enter: "+a[0]);
System.out.println ("\n\nThis the last number you enter: "+a[19]);
}
}
kristinequiling Dit111
Hannah Micah M. Acuavera
DIT-221
complation
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.applet.*;
public class quizhma extends Applet implements ActionListener
{
Button b1,b2,b3,b4,b5,b6;
Label l1,l2;
TextField t1;
public void init()
{
setVisible(true);
setSize(400,300);
setLayout(null);
setBackground(Color.green);
b1 = new Button("Enter");
b1.setBounds(200,50,60,20);
b1.setForeground(Color.yellow);
b1.addActionListener(this);
add(b1);
b2 = new Button("Enter");
b2.setBounds(200,50,60,20);
b2.setForeground(Color.yellow);
b2.addActionListener(this);
b2.setVisible(false);
add(b2);
b3 = new Button("Enter");
b3.setBounds(200,50,60,20);
b3.setForeground(Color.yellow);
b3.addActionListener(this);
b3.setVisible(false);
add(b3);
b4 = new Button("Enter");
b4.setBounds(200,50,60,20);
b4.setForeground(Color.yellow);
b4.addActionListener(this);
b4.setVisible(false);
add(b4);
b5 = new Button("Enter");
b5.setBounds(200,50,60,20);
b5.setForeground(Color.yellow);
b5.addActionListener(this);
b5.setVisible(false);
add(b5);
b6 = new Button("Enter");
b6.setBounds(200,50,60,20);
b6.setForeground(Color.yellow);
b6.addActionListener(this);
b6.setVisible(false);
add(b6);
t1=new TextField("");
t1.setBounds(30,50,150,20);
add(t1);
l2 = new Label("you have gone over the font size limit!");
l2.setBounds(10,140,500,40);
l2.setForeground(Color.blue);
Font fh=new Font("Lucida Console",Font.BOLD,15);
l2.setFont(fh);
l2.setVisible(false);
add(l2);
l1=new Label("");
l1.setBounds(120,100,120,30);
l1.setForeground(Color.red);
Font a=new Font("Lucida Console",Font.ITALIC,6);
l1.setFont(a);
add(l1);
}
public void actionPerformed(ActionEvent hannah)
{
if(hannah.getSource()==b1)
{
Font f = new Font("Lucida Console",Font.BOLD,8);
l1.setText(t1.getText());
l1.setFont(f);
b1.setVisible(false);
b2.setVisible(true);
}
if(hannah.getSource()==b2)
{
Font r = new Font("Lucida Console",Font.BOLD,10);
l1.setText(t1.getText());
l1.setFont(r);
b2.setVisible(false);
b3.setVisible(true);
}
if(hannah.getSource()==b3)
{
Font h = new Font("Lucida Console",Font.BOLD,12);
l1.setText(t1.getText());
l1.setFont(h);
b3.setVisible(false);
b4.setVisible(true);
}
if(hannah.getSource()==b4)
{
Font i = new Font("Lucida Console",Font.BOLD,14);
l1.setText(t1.getText());
l1.setFont(i);
b4.setVisible(false);
b5.setVisible(true);
}
if(hannah.getSource()==b5)
{
Font i = new Font("Lucida Console",Font.BOLD,16);
l1.setText(t1.getText());
l1.setFont(i);
b5.setVisible(false);
b6.setVisible(true);
}
if(hannah.getSource()==b6)
{
l2.setVisible(true);
b6.setEnabled(false);
}
}
}
Ronalyn Estrella
DIT211
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class AppletDIT211ree()
public class AppletDIT211ree extends JApplet implements ActionListener
{
Container con = getContentPane();
JLabel question = new JLabel("What’s your name?");
JTextField answer = new JTextField(10);
JButton press = new JButton("Press me");
public void init()
{
con.add(question);
con.add(answer);
con.add(press);
con.setLayout(new FlowLayout());
con.setnewfontsize("8");
press.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
objectSource();
if(source==btn)
font ron=("comicsans",font.bold,12)
else if(source==btn)
font ron=("comicsans",font.bold,16)
else if(source==btn)
font ron=("comicsans",font.bold,20)
else
font ron=("comicsans",font.bold,24)
txt=new jtextfield("");
btn=setVisisble(false)';
public static void main(String args [])
appletdit211ree=new
appletdit211ree from setTitle("appletdit211ree");
from.setSize(300,100);
from.setvisible(true);
JOptionPane.showMessageDialog(null, "You pressed the button, " + name);
}
}
}
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.applet.*;
public class quizhma extends Applet implements ActionListener
{
Button b1,b2,b3,b4,b5,b6;
Label l1,l2;
TextField t1;
public void init()
{
setVisible(true);
setSize(400,300);
setLayout(null);
setBackground(Color.green);
b1 = new Button("Enter");
b1.setBounds(200,50,60,20);
b1.setForeground(Color.yellow);
b1.addActionListener(this);
add(b1);
b2 = new Button("Enter");
b2.setBounds(200,50,60,20);
b2.setForeground(Color.yellow);
b2.addActionListener(this);
b2.setVisible(false);
add(b2);
b3 = new Button("Enter");
b3.setBounds(200,50,60,20);
b3.setForeground(Color.yellow);
b3.addActionListener(this);
b3.setVisible(false);
add(b3);
b4 = new Button("Enter");
b4.setBounds(200,50,60,20);
b4.setForeground(Color.yellow);
b4.addActionListener(this);
b4.setVisible(false);
add(b4);
b5 = new Button("Enter");
b5.setBounds(200,50,60,20);
b5.setForeground(Color.yellow);
b5.addActionListener(this);
b5.setVisible(false);
add(b5);
b6 = new Button("Enter");
b6.setBounds(200,50,60,20);
b6.setForeground(Color.yellow);
b6.addActionListener(this);
b6.setVisible(false);
add(b6);
t1=new TextField("");
t1.setBounds(30,50,150,20);
add(t1);
l2 = new Label("you have gone over the font size limit!");
l2.setBounds(10,140,500,40);
l2.setForeground(Color.blue);
Font fh=new Font("Lucida Console",Font.BOLD,15);
l2.setFont(fh);
l2.setVisible(false);
add(l2);
l1=new Label("");
l1.setBounds(120,100,120,30);
l1.setForeground(Color.red);
Font a=new Font("Lucida Console",Font.ITALIC,6);
l1.setFont(a);
add(l1);
}
public void actionPerformed(ActionEvent hannah)
{
if(hannah.getSource()==b1)
{
Font f = new Font("Lucida Console",Font.BOLD,8);
l1.setText(t1.getText());
l1.setFont(f);
b1.setVisible(false);
b2.setVisible(true);
}
if(hannah.getSource()==b2)
{
Font r = new Font("Lucida Console",Font.BOLD,10);
l1.setText(t1.getText());
l1.setFont(r);
b2.setVisible(false);
b3.setVisible(true);
}
if(hannah.getSource()==b3)
{
Font h = new Font("Lucida Console",Font.BOLD,12);
l1.setText(t1.getText());
l1.setFont(h);
b3.setVisible(false);
b4.setVisible(true);
}
if(hannah.getSource()==b4)
{
Font i = new Font("Lucida Console",Font.BOLD,14);
l1.setText(t1.getText());
l1.setFont(i);
b4.setVisible(false);
b5.setVisible(true);
}
if(hannah.getSource()==b5)
{
Font i = new Font("Lucida Console",Font.BOLD,16);
l1.setText(t1.getText());
l1.setFont(i);
b5.setVisible(false);
b6.setVisible(true);
}
if(hannah.getSource()==b6)
{
l2.setVisible(true);
b6.setEnabled(false);
}
}
}
Darine Fatima S. Sotomayor
DIT 211
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class AppletDFSS extends JApplet implements ActionListener
{
button btn;
textfield txt;
Container con = getContentPane();
JLabel question = new JLabel("What’s your name?");
JTextField answer = new JTextField(10);
JButton press = new JButton("Press me!");
public void init()
{
btn=new
jbutton("Click Me!");
btn.adDactionListener(This);
con.add(btn);
txt=new
jtextfield(15);
txt=setBounds(20;100,80,40); Font
Fatima=setFont("Arial,font.bold,8);
con.add(text);
}
public void actionPerformed(ActionEvent e)
{
objectSource();
if(source==btn)
font Fatima=("Arial",font.bold,12)
else if
font Fatima=("Arial",font.bold,16)
else if
font Fatima=("Arial",font.bold,20)
else if
font Fatima=("Arial",font.bold,24)
else
txt=new jtextfield("");
btn=setVisisble(false)';
public static void main(String args [])
appletdit211mbm=new
appletdit211mbm from setTitle("appletdit211mbm");
from.setSize(300,100);
from.setvisible(true);
}
}
}
Genelyn Amparo DIT211
maam xnxa huli nah..
whehehehehe...
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class AppletDIT211gca extends Applet implements ActionListener
{
Button btn1;
TextField txt1;
Container con = getContentPane();
JLabel question = new JLabel("Enter your name?");
JTextField answer = new JTextField(10);
JButton press = new JButton("Press me");
public void init()
{
setVisible(true);
setSize(250,200);
setLayout(null);
btn1=new Button("DISPLAY");
btn1.setBounds(15,140,90,40);
btn1.addActionListener(this);
add(btn1);
txt1=new TextField("");
txt1.setBounds(140,50,120,180);
Font a = new Font("Elephant",Font.BOLD,8);
txt1.setFont(a);
add(txt1);
}
public void actionPerformed(ActionEvent h)
{
int w=4;
if(w<=4){
txt1.setText(txt1.getText());
Font k = new Font("Elephant",Font.BOLD,12);
txt1.setFont(k);
}
else if(w<=3){
txt1.setText(txt1.getText());
Font e = new Font("Elephant",Font.BOLD,16);
txt1.setFont(e);
}
else if(w<=2){
txt1.setText(txt1.getText());
Font q = new Font("Elephant",Font.BOLD,20);
txt1.setFont(q);
}
else if(w<=1){
txt1.setText(txt1.getText());
Font m = new Font("Elephant",Font.BOLD,24);
txt1.setFont(m);
}
else{
txt1.setText("");
btn1.setVisible(false);
}
}
genelyn amparo dit211
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class AppletDIT211gca extends Applet implements ActionListener
{
Button btn1;
TextField txt1;
Container con = getContentPane();
JLabel question = new JLabel("Enter your name?");
JTextField answer = new JTextField(10);
JButton press = new JButton("Press me");
public void init()
{
setVisible(true);
setSize(250,200);
setLayout(null);
btn1=new Button("DISPLAY");
btn1.setBounds(15,140,90,40);
btn1.addActionListener(this);
add(btn1);
txt1=new TextField("");
txt1.setBounds(140,50,120,180);
Font a = new Font("Elephant",Font.BOLD,8);
txt1.setFont(a);
add(txt1);
}
public void actionPerformed(ActionEvent h)
{
int w=4;
if(w<=4){
txt1.setText(txt1.getText());
Font k = new Font("Elephant",Font.BOLD,12);
txt1.setFont(k);
}
else if(w<=3){
txt1.setText(txt1.getText());
Font e = new Font("Elephant",Font.BOLD,16);
txt1.setFont(e);
}
else if(w<=2){
txt1.setText(txt1.getText());
Font q = new Font("Elephant",Font.BOLD,20);
txt1.setFont(q);
}
else if(w<=1){
txt1.setText(txt1.getText());
Font m = new Font("Elephant",Font.BOLD,24);
txt1.setFont(m);
}
else{
txt1.setText("");
btn1.setVisible(false);
}
}
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.applet.*;
public class blogbryan extends Applet implements ActionListener
{
Button btn1,btn2,btn3,btn4,btn5,btn6;
TextField t1;
Label l1,l2;
public void init()
{
setVisible(true);
setSize(400,300);
setLayout(null);
setBackground(Color.green);
btn1 = new Button("Enter");
btn1.setBounds(200,50,60,20);
btn1.setForeground(Color.yellow);
btn1.addActionListener(this);
add(b1);
btn2 = new Button("Enter");
btn2.setBounds(200,50,60,20);
btn2.setForeground(Color.yellow);
btn2.addActionListener(this);
btn2.setVisible(false);
add(b2);
btn3 = new Button("Enter");
btn3.setBounds(200,50,60,20);
btn3.setForeground(Color.yellow);
btn3.addActionListener(this);
b3.setVisible(false);
add(b3);
btn4 = new Button("Enter");
btn4.setBounds(200,50,60,20);
btn4.setForeground(Color.yellow);
btn4.addActionListener(this);
b4.setVisible(false);
add(b4);
btn5 = new Button("Enter");
btn5.setBounds(200,50,60,20);
btn5.setForeground(Color.yellow);
btn5.addActionListener(this);
btn5.setVisible(false);
add(b5);
btn6 = new Button("Enter");
btn6.setBounds(200,50,60,20);
btn6.setForeground(Color.yellow);
btn6.addActionListener(this);
btn6.setVisible(false);
add(b6);
t1=new TextField("");
t1.setBounds(30,50,150,20);
add(t1);
l2 = new Label("you have gone over the size limit=)");
l2.setBounds(10,140,500,40);
l2.setForeground(Color.blue);
Font fh=new Font("Lucida Console",Font.BOLD,15);
l2.setFont(fh);
l2.setVisible(false);
add(l2);
l1=new Label("");
l1.setBounds(120,100,120,30);
l1.setForeground(Color.red);
Font a=new Font("Lucida Console",Font.ITALIC,5);
l1.setFont(a);
add(l1);
}
public void actionPerformed(ActionEvent hannah)
{
if(bryan.getSource()==b1)
{
Font f = new Font("Times New Roman",Font.BOLD,7);
l1.setText(t1.getText());
l1.setFont(f);
b1.setVisible(false);
b2.setVisible(true);
}
if(bryan.getSource()==b2)
{
Font r = new Font("Lucida Console",Font.BOLD,10);
l1.setText(t1.getText());
l1.setFont(r);
b2.setVisible(false);
b3.setVisible(true);
}
if(bryan.getSource()==b3)
{
Font h = new Font("Lucida Console",Font.BOLD,12);
l1.setText(t1.getText());
l1.setFont(h);
b3.setVisible(false);
b4.setVisible(true);
}
if(bryan.getSource()==b4)
{
Font i = new Font("Lucida Console",Font.BOLD,14);
l1.setText(t1.getText());
l1.setFont(i);
b4.setVisible(false);
b5.setVisible(true);
}
if(bryan.getSource()==b5)
{
Font i = new Font("Lucida Console",Font.BOLD,16);
l1.setText(t1.getText());
l1.setFont(i);
b5.setVisible(false);
b6.setVisible(true);
}
if(bryan.getSource()==b6)
{
l2.setVisible(true);
b6.setEnabled(false);
}
}
}
Post a Comment