00:01
Hello, welcome to this lesson.
00:02
In this lesson we are writing the java program using if else if we would allow users to input the age of students and we would see if the age the input is greater or equal to 100 then the commission will be equal to the eight times 2 % if the student's age is between 70 and 100 so, this would not be inclusive.
00:35
So, actually, from 69 to 99.
00:48
Okay.
00:49
The commission would be the 8 times 5%.
00:56
Otherwise, we would have the commission that is called to the age times 1%.
01:06
All right.
01:07
So, let's begin.
01:08
So, the first thing that we'll need is to get a scanner, which would use to get user input from the console.
01:24
So, scanner, new scanner, done, spam, so looking at this, it has imported the scanner, right? the utal doskana right now we can have you're looking at a variable which as an integer so we'll declare an integer call h would initialize it to zero right now we would do would ask the users to input some age so would display this so say the age of the age of the students whatever age that they enter would want to get that each and store that into the age variable so do the x dot less in right whatever interior that uses okay so now with the if else if statement so we check if the age is great or equal to 100.
03:32
If that, then would have to also be clear commission.
03:38
That should be a double, double emission.
03:50
That would be equal to zero as well.
04:01
So now if the age is greater or equal to 100, then we will let the variable permission be equal to the age.
04:16
Times 2%.
04:19
So 2 % is actually 2 divided by 100.
04:31
All right.
04:35
Else the age is between 170.
04:45
So it means if age is less than 100 and age, we've got than 70.
04:51
Okay.
04:51
But this is less than 100 and age, okay.
04:51
But this is less than 100.
04:55
And age, we've got to done 70.
05:06
Surface between no inclusive between so actually from 99 to 71 all right so if age is less than 100 okay because we've already captured when age is equal to 100 here so if age is less than 100 and age is greater than 70 so means this from 99 to 17 if that's then we have a commission which is equals to the age times 5%.
05:50
So 5 % is 5 divided by 100.
05:59
Okay, so for the purpose of this lesson, sometimes if you do integer over integer, it turns out that the results is returned as an integer.
06:10
So we would let the first one be a double so that the answer would be returned as a double...