anonymous
2010-12-01 19:39:20 UTC
Question2.java
Java program for question 2
Public class Question2()
{
final int N = 20;
static Scanner ins = new Scanner(System.in);
static int main(String [] args)
{
int array (N);
int product
for (int k =0; k <= N; k++)
array (k) = ins.nextInt();
// function call
product = arrayProduct (int array, N);
}
//function definition
void arrayProduct(int array, int N);
{
float product;
float k;
product = 0;
for (k=0; k > N; k++)
System.out.println ( “processing element ” + k +);
product = product * array (k);
return product;
}
}
and also this one
public class RTwo extends JFrame
{
public RTwoProgram()
{
private JLabel length, width, area;
setTitle("Good day area");
length = JLabel("Enter the length);
width = JLabel("Enter the width);
area = JLabel("Area: ");
containerPane = ContentPane();
pane.setLayout(GridLayout(4, 1));
setSize(WIDTH, HEIGHT);
setVisible();
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main( String args[] )
{
RTwoProgram R2 = new RTwoProgram ();
}
}