Embed
Email

public class Welcome

Document Sample
public class Welcome
Shared by: asimhashmi
Categories
Tags
Stats
views:
7
posted:
12/9/2011
language:
pages:
5
Welcome

public class Welcome {



public static void main (String args[])



{



System.out.print("PAkistan");

}



}









Star4

public class Star4{

public static void main (String args[])

{

for(int i=5; i>= 1; i--)

{



for(int k=1; k50)

{

passes++;

}

else

{

failures++;

}

student++;

}

JOptionPane.showMessageDialog(null,"Passes:=> " +passes+ " Failures

:=>"+failures);

System.exit (0);

}

}

Good Morning



public class Goodmorning {



public static void main (String args [])



{



System.out.print("Good Morning Pakistan");

}

}









Average

import javax.swing.JOptionPane;

public class Average{

public static void main (String args[])

{

int C=5;

System.out.println (C);5

System.out.println (C++);5

System.out.println (C);6

}

}









import javax.swing.JOptionPane;

public class Average{

public static void main (String args[])

{

int total,

gradecounter,

gradevalue,

aver;

String grade;

total=0;

gradecounter=1;

while (gradecounter <=10)

{

grade = JOptionPane.showInputDialog("Enter grade");

gradevalue = Integer.parseInt(grade);

total= total + gradevalue;



gradecounter = gradecounter + 1;

}

aver = total/10;

JOptionPane.showMessageDialog(null,"classaverage"+aver);

System.exit(0);

}

}









Addition.



import javax.swing.JOptionPane;

public class Addition{

public static void main (String args[])

{

String firstnumber;

String secondnumber;

int num1;

int num2;

int sum;

firstnumber = JOptionPane.showInputDialog("Enter First Number");

secondnumber = JOptionPane.showInputDialog("Enter Second Number");

num1 = Integer.parseInt(firstnumber);

num2 = Integer.parseInt(secondnumber);

sum = num1 + num2;

JOptionPane.showMessageDialog(null,"The sum is" +sum);

System.exit(0);

}

}

public class Inar{

public static void main (String args[])

{

int n [];

n=new int[10];

for (int i=0; i
{

n[i]=i+2;

}

for (int k=0; k
{

System.out.println("Index : " + k + " Array Value : " +n[k]);

}

System.exit(0);

}

}


Shared by: asimhashmi
Other docs by asimhashmi
Account detail
Views: 0  |  Downloads: 0
Random Access Memory
Views: 0  |  Downloads: 0
TYPES OF VERBS
Views: 3  |  Downloads: 0
Balance Inquiry
Views: 2  |  Downloads: 0
Doc1
Views: 0  |  Downloads: 0
asim drw with diamention.1
Views: 0  |  Downloads: 0
asim drw with diamention.1
Views: 0  |  Downloads: 0
warrantymatrix 051910
Views: 0  |  Downloads: 0
asim
Views: 9  |  Downloads: 0
Related docs
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!