11,Given a JPanel panel2 that sits in a JFrame. Create and add Go! and Stop! buttons to panel2.

12,Given the method average below, write an overloaded method average that has three double variables as its parameters and returns their average.

public static void double average(double score1, double score2)

     { return (score1+score2)/2; }

13,Given the following method header:

     public String getStudent(int idNum)

write two overloaded method headers (don’t write the body!)

14,Write a method named SetTemperature to compute and return the temperature which is equivalent to 50% of the current temperature value received.

15,What is the value of total displayed in showTotal, given the statement

      Cashier abc = new Cashier( 15, 10);

using this definition:

public class Cashier {

      int total;

      public Cashier( int p, int q) {

      int total = p * q;

      }

      public void showTotal() {

         System.out.println(“total=”+total);

     }

}



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *