forked from Denisolt/CSCI-160
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrail_Driver.java
More file actions
20 lines (16 loc) · 916 Bytes
/
Trail_Driver.java
File metadata and controls
20 lines (16 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class Trail_Driver
{
public static void main()
{
int [] trail_points = {100, 150, 105, 120, 90, 80, 50, 75, 75, 70, 80, 90, 100};
Trail myTrail = new Trail(trail_points);
boolean isLevel=myTrail.isLevelTrailSegment(7,10); //75, 75, 70, 80
System.out.println("Segment(7-10) isLevel is "+isLevel); // Should return true
isLevel=myTrail.isLevelTrailSegment(2,12); //105, 120, 90, 80, 50, 75, 75, 70, 80, 90, 100
System.out.println("Segment(2-12) isLevel is "+isLevel); // Should return false
boolean isDifficult=myTrail.isDifficult();
System.out.println("Trail is difficult is "+isDifficult);
// Challenge: Modify isDifficult to take (similar to isLevelTraiSegment) a starting and ending index.
// then show that it works (one case to return true and another to return false)
}
}