-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdistConversion.cs
More file actions
52 lines (51 loc) · 1.08 KB
/
Copy pathdistConversion.cs
File metadata and controls
52 lines (51 loc) · 1.08 KB
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
42
43
44
45
46
47
48
49
50
51
52
/*
Class: CSE 1321
Section: 04
Term: Fall 2023
Instructor: Ermias Memo
Name: Alex Bates
Assignment: Conversion Program
*/
class distConversion {
private float inch, foot, yard;
public distConversion() {
inch = 0.0f;
foot = 0.0f;
yard = 0.0f;
}
public distConversion(float inch, float foot, float yard) {
this.inch = inch;
this.foot = foot;
this.yard = yard;
}
public float getInch() {return inch;}
public float getFoot() {return foot;}
public float getYard() {return yard;}
public void setInch(float inch) {this.inch = inch;}
public void setFoot(float foot) {this.foot = foot;}
public void setYard(float yard) {this.yard = yard;}
public float convItoF() {
foot = inch / 12f;
return foot;
}
public float convFtoI() {
inch = foot * 12f;
return inch;
}
public float convItoY() {
yard = inch / 36f;
return yard;
}
public float convYtoI() {
inch = yard * 36f;
return inch;
}
public float convFtoY() {
yard = foot / 3f;
return yard;
}
public float convYtoF() {
foot = yard * 3f;
return foot;
}
}