-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTestCircle.java
More file actions
63 lines (52 loc) · 1.86 KB
/
Copy pathTestCircle.java
File metadata and controls
63 lines (52 loc) · 1.86 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
53
54
55
56
57
58
59
60
61
62
63
/*
// Writen by Edgar Colin
// Aug 12th 2016
// Class: CIS163 Java I
// Prof: Michael Parmeley
// Section 14887
// HW 4 Problem 6(b)
// Filename: TestCircle.java
TestCircle main() method declares several Circle objects.
CircleSmall, CircleBig using the constructor and
the setRadius() method. 2 values are assigned
one Circle a small radius value, and another a larger
radius value. A third circle object called defaultCircle
retains the value assigned at construction.
The Circles are displayed with all the values for all the
Circle object paramemters.
*/
import java.util.*;
public class TestCircle
{
public static void main(String[] args)
{
double radiusSmall = .25; // Small Radius
double radiusBig = 100; // Big Radius
Circle CircleSmall = new Circle(); // Small Circle Instantiation
Circle CircleBig = new Circle(); // Big Circle Instantiation
Circle CircleDefault = new Circle();// Default Circle Instantiation
// Setting instance parameters using the
// setMethod within the Circle Class
CircleSmall.setRadius(radiusSmall);
CircleBig.setRadius(radiusBig);
//The default Circle as its name suggests contains
//the default values assigned to the constructor Circle()
// The following section uses the display method
// within the circle class set to display the
// contents of the circle method containing
// its parameters.
System.out.println("**Small Circle Properties**");
System.out.println(" ");
CircleSmall.display();
System.out.println(" ");
System.out.println("**Big Circle Properties**");
System.out.println(" ");
CircleBig.display();
System.out.println(" ");
System.out.println("**Default Circle Properties**");
System.out.println(" ");
CircleDefault.display();
System.out.println(" ");
System.out.println(" ---End of Program--- ");
}
}