iSayDona

Showing category "Copro2" (Show all posts)

iSay_JFrame

Posted by donabel malagamba on Friday, July 8, 2011, In : Copro2 
import javax.swing.*;
public class JFrameDemo {
public static void main(String[] args) {
 JFrame aFrame = new JFrame("This is a frame");
 aFrame.setSize(200,250);
 aFrame.setVisible(true);
 
 aFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
   
   
}
   
Continue reading ...
 

iSay_namerace

Posted by donabel malagamba on Friday, July 8, 2011, In : Copro2 
import javax.swing.*;
class race implements Runnable{
String c;
race(String c) {
    this.c = c;
}   
// override run() method in interface
public void run() {
    for(int i=0; i<4999; i++) {
        System.out.print(c);
       
        try{
           Thread.sleep((int)(Math.random()));
        } catch( InterruptedException e ) {
            System.out.println("Interrupted Exception caught");
        }
    }
    System.out.println("is the winner");
}   

public static void main(String[] args) {
 String a...

Continue reading ...
 

iSay_gotoofar

Posted by donabel malagamba on Friday, July 8, 2011, In : Copro2 
import javax.swing.*;
public class GoTooFar {
   
    public static void main(String[] args)throws ArithmeticException {
     int arr1 [] = new int [5];
      int num;
     
      try{
       for (int x = 0; x < 5; x++){
        String xnum = JOptionPane.showInputDialog(null, "Enter number: ");
        num = Integer.parseInt(xnum);
        arr1 [x] = num;
       }
      
        String xnum = JOptionPane.showInputDialog(null, "Enter number From 0 - 4 : ");
       num = Integer.parseInt(xnum);
      
    ...
Continue reading ...
 

iSay_household

Posted by donabel malagamba on Friday, July 8, 2011, In : Copro2 


Continue reading ...
 

iSay_book

Posted by donabel malagamba on Friday, July 8, 2011, In : Copro2 
import javax.swing.*;
public class Book {
    String title;
    static int pages;
    public static void main(String[] args) {
     String xtitle = JOptionPane.showInputDialog(null, "Enter book title : ");
     String xpages = JOptionPane.showInputDialog(null, "Enter number of pages : ");
     String xgradeLVL = JOptionPane.showInputDialog(null, "Enter the grade level field : ");
     
     Book obj = new Book();
     obj.gettitle();
     obj.settitle(xtitle);
     obj.getpages();
     obj.setpages(pages...

Continue reading ...
 

iSay_pay

Posted by donabel malagamba on Friday, July 8, 2011, In : Copro2 
import javax.swing.*;
public class Pay
{
 public static void main (String []args){
  double hoursWorked= 0;
  double payRate= 5.65;
  double withholdingRate= 0.10;
  double grossPay= 0;
  double netPay= 0;
   grossPay= ComputeNetPay (hoursWorked, payRate, withholdingRate);
   withholdingRate = ComputeNetPay (grossPay);
   netPay = ComputeNetPay (grossPay, withholdingRate);
  System.out.println ("Gross Pay= "+grossPay);
  System.out.println ("With Holding Rate= "+withholdingRate);
  System.out.println ("Net...

Continue reading ...
 

iSay_copro2_change

Posted by donabel malagamba on Friday, July 8, 2011, In : Copro2 
import javax.swing.*;
public class Numbers{
 public static void main (String[]args){
  int value1 =0;
  int value2 =0;
  int sum =0;
  int difference=0;
   value1=getValue1(value1);
   value2=getValue2(value2);
   sum=getSum(value1,value2);
   difference=getDifference(value1,value2);
  System.out.println ("The sum of " +value1+"+"+value2+"=" + sum);
  System.out.print ("The difference of " +value1+"+"+value2+"="+ difference); 
 }
 public static int getValue1 (int value1){
  int a=setValue1 (value1);
  retur...

Continue reading ...
 
 

harana.mp3

iSay_explore


donabel malagamba college IT student

Recent Posts