-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestYourCode.java
More file actions
119 lines (92 loc) · 3.68 KB
/
TestYourCode.java
File metadata and controls
119 lines (92 loc) · 3.68 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package com.employee;
import java.util.Arrays;
public class TestYourCode {
public static void testTeams(int[] even, int[] odd) {
int[] testEven = { 190 ,188 ,186 ,180 ,176 ,174 ,172 ,166 ,160 ,156 ,140 };
int[] testOdd = {197, 195, 189, 187, 183, 179, 177, 175, 169, 167, 165};
if (Arrays.equals(even, testEven) && Arrays.equals(odd, testOdd)) {
System.out.println("Congratulations! you formed the correct teams");
} else {
System.out.println("*************** Check your code again ***************");
}
}
public static void testTwoBestPerformers(int best, int secondBest) {
if (best == 156 && secondBest == 180) {
System.out.println("Congratulations! You found the two best Performers");
} else {
System.out.println("*************** Check your code again ***************");
}
}
public static void testSearchForAnEmployee(String str) {
if (str.equals("3459119683")) {
System.out.println("Congratulations! You found the searched employee with correct contact info");
} else {
System.out.println("*************** Check your code again ***************");
}
}
public static void testHighestToMedianSalary(float ratio) {
if (ratio == 1.8333334f) {
System.out.println("Congratulations! You found the correct Ratio");
} else {
System.out.println("*************** Check your code again ***************");
}
}
public static void testHighestContractSalaries(int[] topFive) {
int[] testFive = {88000, 88000, 85000, 85000, 80000};
if(Arrays.equals(topFive, testFive)) {
System.out.println("Congratulations! You found the correct top Five Work Orders");
} else {
System.out.println("*************** Check your code again ***************");
}
}
public static void testUniteSalaries(float ratio) {
if (ratio == 1.8333334f) {
System.out.println("Congratulations! You found the correct Ratio");
} else {
System.out.println("*************** Check your code again ***************");
}
}
public static void testFrequencyOfVisitedWebsites(String[] res, int[] freq) {
int[] knownFreq = {6,10,2,4};
if (Arrays.equals(freq,knownFreq)) {
System.out.println("Congratulations! You compiled the correct information");
} else {
System.out.println("*************** Check your code again ***************");
}
}
public static void testSimilarNamedTeams(int count) {
if (count == 7) {
System.out.println("Congratulations! You found the correct number of teams formed");
} else {
System.out.println("*************** Check your code again ***************");
}
}
public static void testNewEmployeeStructure(int tail) {
if(tail == 197) {
System.out.println("Congratulations! You have formed the correct LinkedList");
} else {
System.out.println("*************** Check your code again ***************");
}
}
public static void testAddNewEmployee(int position) {
if(position == 11) {
System.out.println("Congratulations! You have entered at the correct position");
} else {
System.out.println("*************** Check your code again ***************");
}
}
public static void testRemoveAbscondedEmployee(int abscondedEmployee) {
if(abscondedEmployee == 189) {
System.out.println("Congratulations! You have removed the correct employee");
} else {
System.out.println("*************** Check your code again ***************");
}
}
public static void testFoodCouponDistribution(int front,int rear) {
if (front == 123 && rear == 106 || front == 105 && rear == 106 || front == 105 && rear == 117 || front == 190 && rear == 117) {
System.out.println("Congratulations! You have successfully implemented the queue");
} else {
System.out.println("*************** Check your code again ***************");
}
}
}