-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprog.java
41 lines (38 loc) · 952 Bytes
/
prog.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Write a description of class prog here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class prog
{
// instance variables - replace the example below with your own
private int x;
/**
* Constructor for objects of class prog
*/
public prog()
{
// initialise instance variables
int l = 700;
int b = 500;
int p = 0;
int w = 0;
System.out.println("The length of the land " + l);
System.out.println("The breadth of the land " + b);
p = 2*(l+b);
w = 4*p;
System.out.println("The required length of wire is " + w+" m");
}
/**
* An example of a method - replace this comment with your own
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
public int sampleMethod(int y)
{
// put your code here
return x + y;
}
}