- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLengthProgram.java
More file actions
Latest commit
40 lines (34 loc) · 753 Bytes
/
Copy pathLengthProgram.java
File metadata and controls
40 lines (34 loc) · 753 Bytes
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
importjava.util.*;
classLengthProgram
{
intfeet;
intinch;
publicLengthProgram()
{
this.feet = 0;
this.inch = 0;
}
publicLengthProgram(intx, inty)
{
this.feet = x;
this.inch = y;
}
publicLengthProgram(intx)
{
this.feet = x / 12;
this.inch = x;
}
voiddisplay()
{
System.out.println("feet=" + this.feet + "\ninch=" + this.inch + "\n");
}
publicstaticvoidmain(String[] arrstring)
{
LengthPrograml1 = newLengthProgram();
LengthPrograml2 = newLengthProgram(5, 60);
LengthPrograml3 = newLengthProgram(120);
l1.display();
l2.display();
l3.display();
}
}