-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoStuff.java
More file actions
189 lines (179 loc) · 7.62 KB
/
Copy pathdoStuff.java
File metadata and controls
189 lines (179 loc) · 7.62 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import java.util.*;
/**
*
* @author SoloCode JSHDVR
*/
public class doStuff {
private final String vision = "By 2025, the College envisions to be a premier local institution of higher leaening in Region 3 committed to the hollistic development of the human person and society.";
private final String mission = "To produce well-trained,skilled,dynamic, and competitive individuals imbued with values and attitudes responsive to the changing needs of the local, national and global communities.";
private final String stringG1 = "Provide opportunities that will enable individuals to acquire a high level of professional, technical and vocational courses of studies.";
private final String stringG2 = "Develop innovative programs, projects and models of practice by undertaking research and studies.";
private final String stringG3 = "Promote community development through relevant extension programs.";
private final String stringG4 = "Provide opportunities for entrepreneurship and employability of graduates.";
private final String visionCCS = "The College of Computer Studies Shall be a center of excellence in Information Technology and Computer Science for providing professional and technological training, scientific and innovative research and relevant community service.";
private final String missionCCS = "The College of Computer Studies shall produce Information Technology and Computer Science professionals equipped with knowledge, skills, strong moral values, well-develop personality and exceptional abilities, thus becoming the preferred and prestigious source of services and manpower.";
private final char[] visionChar = vision.toCharArray();
private final char[] missionChar = mission.toCharArray();
private final char[] goal1Char = stringG1.toCharArray();
private final char[] goal2Char = stringG2.toCharArray();
private final char[] goal3Char = stringG3.toCharArray();
private final char[] goal4Char = stringG4.toCharArray();
private final char[] CCSvisionChar = visionCCS.toCharArray();
private final char[] CCSmissionChar = missionCCS.toCharArray();
private String xasd;
public String getXasd() {
return xasd;
}
public void setXasd(String xasd) {
this.xasd = xasd;
}
private final String[] arrChoice = {"",vision,mission,stringG1,stringG2,stringG3,stringG4,visionCCS,missionCCS};
public String getArrChoice(int i) {
return arrChoice[i];
}
static int score;
private int size;
private String choice,input;
private String checkedAnswer="";
public String accuracy;
public String getAccuracy() {
return accuracy;
}
public void setAccuracy() {
double x =(double)getScore();
double y =(double)getSize();
double result = x/y;
result = result*100;
this.accuracy = String.valueOf((int)result);
}
public void strCompare(){
if (getInput().length()<=getArrChoice(getRandomNum()).length()) {
notGreaterThanChoice();
} else {
isGreaterThanChoice();
}
}
private int firstRand;
public int getFirstRand() {
return firstRand;
}
public void setFirstRand(int firstRand) {
this.firstRand = firstRand;
}
public int getSecondRand() {
return secondRand;
}
public void setSecondRand(int secondRand) {
this.secondRand = secondRand;
}
private int secondRand;
private void randomize() {
getRandomNum();
}
public int randomPick;
public int getRandomNum(){
return randomPick;
}
public int setRandomNum() {
int maxValue = 7;
int random = 0;
while (true) {
random = (int) (Math.random() * (maxValue + 1));
break;
}
return randomPick = random+1;
}
public int getScore() {
return score;
}
public void setScore(int score) {
if(score!=0){
doStuff.score += score;
}else{
doStuff.score = 0;
}
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public String getChoice() {
return choice;
}
public void setChoice(String choice) {
this.choice = choice;
}
public String getInput() {
return input;
}
public void setInput(String input) {
this.input = input;
}
public String getCheckedAnswer() {
return checkedAnswer;
}
public void setCheckedAnswer(String checkedAnswer) {
this.checkedAnswer = checkedAnswer;
}
public String compared(){
return null;
}
private void notGreaterThanChoice() {
char[] choiceArray = getArrChoice(getRandomNum()).toCharArray();
char[] inputArray = getInput().toCharArray();
int inputLength = getInput().length(),arrayChoice = getArrChoice(getRandomNum()).length(), y = 0;
String x = "";
StringBuilder sb = new StringBuilder();
sb.append("<HTML><p ALIGN=CENTER - >");
getArrChoice(getRandomNum());
if (inputLength<=arrayChoice) {
for (int i = 0; i < input.length(); i++) {
System.out.print("first for if lenght is < choidce");
if (inputArray[i]==choiceArray[i]) {
System.out.println(inputArray[i]);
System.out.println(choiceArray[i]);
sb.append("<font color=\"green\">");
sb.append(inputArray[i]);
y++;
System.out.println("if correct");
}else{
sb.append("<font color=\"red\">");
sb.append(inputArray[i]);
System.out.print("if wrong");
}
}x = "</font></p></HTML>";
} else if(inputLength>arrayChoice){
int counter = 0;
for (int i = 0; i < arrayChoice; i++) {
System.out.print("first for if lenght is < choidce");
counter++;
if (inputArray[i]==choiceArray[i]) {
System.out.println(inputArray[i]);
System.out.println(choiceArray[i]);
sb.append("<font color=\"green\">");
sb.append(inputArray[i]);
y++;
System.out.println("if correct");
}else{
sb.append("<font color=\"red\">");
sb.append(inputArray[i]);
System.out.print("if wrong");
}
}
for (int i = counter; i < input.length(); i++) {
sb.append("<font color=\"gray\">");
sb.append(inputArray[i]);
}
}
doStuff.score = y;
System.out.println("end of the loop if legnt is < choice");
System.out.println(doStuff.score);
setCheckedAnswer(sb.toString()+x);
System.out.println(getCheckedAnswer());
}
private void isGreaterThanChoice() {
notGreaterThanChoice();
}
}