MCPcopy Create free account
hub / github.com/careercup/ctci / createPoints

Method createPoints

java/Chapter 7/Question7_6/Question.java:73–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71 }
72
73 public static GraphPoint[] createPoints() {
74 int n_points = 100;
75 System.out.println("Points on Graph\n***************");
76 GraphPoint[] points = new GraphPoint[n_points - 1];
77 for (int i = 0; i < n_points / 2; i++) {
78 GraphPoint p = new GraphPoint(i, 2.3 * ((double)i) + 20.0);
79 points[i] = p;
80 System.out.println(p.toString());
81 }
82 for (int i = 0; i < n_points / 2 - 1; i++) {
83 GraphPoint p = new GraphPoint(i, 3.0 * ((double)i) + 1.0);
84 points[n_points / 2 + i] = p;
85 System.out.println(p.toString());
86 }
87 System.out.println("****************\n");
88 return points;
89 }
90
91 public static void main(String[] args) {
92 GraphPoint[] points = createPoints();

Callers 1

mainMethod · 0.95

Calls 1

toStringMethod · 0.95

Tested by

no test coverage detected