00:01
Okay, so we have a problem pulled from barron's ap cs 7th edition.
00:06
This is chapter 1, problem 25.
00:09
We have this code block here.
00:11
You can read through it yourself, kind of make the determination what's happening.
00:15
And what's happening is essentially, we're given this code statement.
00:19
We have a while loop here with a couple of instantiated values.
00:26
What's happening is the while loop is going to run while num is greater than 10.
00:32
And temp is taking the modulus of 10.
00:35
So it's going to take the remainder of whatever num is assigned, divided by 10, take the remainder, assign that as temp.
00:41
Num is going to equal, in this case, this is the same as going num is equal to num divided by 10.
00:58
And new num is going to be assigned a value of new num times 10.
01:03
Initially, it said it's zero.
01:04
So the first pass is zero times 10 plus temp.
01:07
So that is going to be given, or that's going to be assigned a new value after taking whatever the modulus is up here, being assigned that.
01:17
And then after the while loop terminates, it's going to print out the new num value, since it's outside.
01:24
And we're being asked, which is a true statement about the segment? if number one states, if 100 is less than or equal to num, is less than or equal to 1000 initially, the final value of new num must be in range of 10 less than new num, less than 100.
01:42
And that is not true...