1var gradeOut = 70;
2var totalGrade = 80;
3
4if (gradeOut >= 90)
5 gradeOut+= "My letter grade is: A";
6 else if (totalGrade < 90 && totalGrade >= 80)
7 gradeOut+= "My letter grade is: B";
8 else if (totalGrade < 80 && totalGrade >= 70)
9 gradeOut+= "My letter grade is: C";
10 else if (totalGrade < 70 && totalGrade >= 60)
11 gradeOut+= "My letter grade is: D";
12 else if (totalGrade < 60)
13 gradeOut+= "My letter grade is: F";
14
15//here's the same thing using switch(true). Requires var gradeOut (is currently at top of page
16switch(true) {
17case gradeOut<60:
18 gradeOut= "My letter grade is: F";
19 break;
20case gradeOut<70:
21 gradeOut= "My letter grade is: D";
22 break;
23case gradeOut<80:
24 gradeOut="My letter grade is: C";
25 break;
26}
27
1if (!password.equals(confirmPassword))
2 {
3 binding.editConfirmPasswordSignUpUser.setError(getString(R.string.please_enter_your_confirm_password));
4 binding.editConfirmPasswordSignUpUser.requestFocus();
5 return;
6 }
1if (!password.equals(confirmPassword))
2 {
3 binding.editConfirmPasswordSignUpUser.setError(getString(R.string.please_enter_your_confirm_password));
4 binding.editConfirmPasswordSignUpUser.requestFocus();
5 return;
6 }
1if (unfinishedFunctionCollatingHistory.getIsSuccess()) {
2 AnalyzingStatusCode.ANALYZED
3} else {
4 if ((!unfinishedFunctionCollatingHistory.getIsSuccess() && functionCollatingCode.equals(FunctionCollatingCode.TFIDFFRAG))) {
5 AnalyzingStatusCode.ERROR_ANALYSIS_DAC
6 } else {
7 if ((!unfinishedFunctionCollatingHistory.getIsSuccess() && functionCollatingCode.equals(FunctionCollatingCode.TFIDFDOC))) {
8 AnalyzingStatusCode.ERROR_ANALYSIS_IMPACT
9 } else {
10 AnalyzingStatusCode.ERROR_ANALYSIS_APPROVAL_ROUTE;
11 }
12 }
13}