Answer:
3 6 18
Explanation:
<u>Code segment</u><u>:</u>
int i = 1, mult3 = 3;
while (mult3 < 20) {
// We assume the body of the while loop to be enclosed in {}
// Otherwise the code will print 3 in an infinite loop
System.out.print(mult3 + " ");
i++;
mult3 *= i;
}
Let us iterate through the while loop:
i=1 , mult3 = 3
i=2 , mult3 = 6
i=3 , mult3 = 18
i=4, mult3 = 72 ( The while loop terminates)
So the code will print out the following result:
3 6 18
Answer:
The method in Python is as follows;
def licenseNum(customID,licenseYear):
return (100000 * customID) + licenseYear
print(licenseNum(777,2014))
Explanation:
This line declares the method with its parameters
def licenseNum(customID,licenseYear):
This line returns the expected output
return (100000 * customID) + licenseYear
The method is tested using:
print(licenseNum(777,2014))
If someone tells you to stop shouting, it's another way of saying, "TURN OFF YOUR CAPS LOCK." When someone is TYPING AN ENTIRE SENTENCE IN ALL CAPITAL LETTERS, that person is SHOUTING. It is not proper netiquette to TYPE IN ALL CAPS, especially in e-mail