1 00:00:00,420 --> 00:00:04,320 We can test many conditions using the if else if al statement. 2 00:00:05,850 --> 00:00:11,750 You saw the normal LaFalce lets you test one condition if the condition is true, Javor runs the if 3 00:00:11,760 --> 00:00:18,120 statement and if the condition is false, Java skips the statement and runs the code inside ELT's. 4 00:00:22,690 --> 00:00:27,250 In this lesson, you're going to learn to use, if else, if else, to test many conditions. 5 00:00:29,200 --> 00:00:34,630 Between anything else, you can have many Elsas statements and Java only runs the first statement that 6 00:00:34,630 --> 00:00:35,540 ends up being true. 7 00:00:35,710 --> 00:00:37,030 The rest are ignored. 8 00:00:38,730 --> 00:00:43,710 So back in her coat, I'm going to change the grade back to 65 five and I'm going to change the first 9 00:00:43,710 --> 00:00:49,740 condition to say if grade is bigger than or equal to 80, then I'm going to print. 10 00:00:50,130 --> 00:00:51,030 You got in a. 11 00:00:57,660 --> 00:01:03,000 And now I'm going to write a series of statements based on the image we just saw, so we'll say else 12 00:01:03,000 --> 00:01:05,250 if greed is bigger than or equal to 70. 13 00:01:11,570 --> 00:01:13,130 Well, print, you've got to be. 14 00:01:20,130 --> 00:01:22,320 And if it's greater than or equal to 60. 15 00:01:32,320 --> 00:01:33,970 We'll say you got to see. 16 00:01:39,060 --> 00:01:41,190 And if it's greater than or equal to 50. 17 00:01:49,090 --> 00:01:50,640 Will print, you got a D. 18 00:02:03,120 --> 00:02:04,650 Otherwise, you got enough. 19 00:02:09,229 --> 00:02:10,220 That's runner code. 20 00:02:16,210 --> 00:02:19,480 And the students scored at 65, which warrants a C. 21 00:02:22,220 --> 00:02:23,810 The first condition is false. 22 00:02:24,230 --> 00:02:29,360 The second condition is false, and the third condition is true because the student's grade is higher 23 00:02:29,360 --> 00:02:30,050 than 60. 24 00:02:30,590 --> 00:02:33,800 The other runs that code and it ignores the rest. 25 00:02:36,170 --> 00:02:39,350 So instead of sixty five, we're going to set the students grade to 40. 26 00:02:43,680 --> 00:02:45,570 All right, rerunning that code. 27 00:02:48,760 --> 00:02:49,630 You've got enough. 28 00:02:50,810 --> 00:02:53,240 That is because all the conditions are false. 29 00:02:57,660 --> 00:02:59,700 So Jova runs the statement. 30 00:03:01,210 --> 00:03:04,540 I encourage you to play with the great value in test each condition. 31 00:03:06,930 --> 00:03:13,380 In this lesson, you changed a series of, if elusive final statements, Java tests each statement until 32 00:03:13,380 --> 00:03:16,410 one of them is true and then it runs the code inside. 33 00:03:18,370 --> 00:03:22,000 And if all the conditions are false, Java runs the statements.