Ask your own question, for FREE!
Computer Science 16 Online
kekeman:

Select the missing comparison operator for the following Python code that prints a countdown from 10 to 0 inclusive. x = 10 while x /* Missing operator */ 0: print(x) x = x − 1 print("Blast off!") == != >= <=

kekeman:

If you know a person's name, there are a finite number of possibilities to obtain their credit card number. The expiration date on a card only slightly complicates the problem, given how fast modern computers can work. Which of the following is the least invasive way the merchant's website can protect credit card owners from malicious users? Asking for more personal information Calling users to verify the purchase Limiting the number of incorrect trials Recording users' IP addresses

kekeman:

Another question I was thinking either the first one or last one

kekeman:

The word "invasive" is throwing me off

kekeman:

@ultrilliam

kekeman:

@smokeybrown

SmokeyBrown:

For the question about the countdown and the missing operator, you want the countdown to keep going from 10, all the way down to 0 (including 0). So, the while loop needs to keep repeating as long as x is greater than or equal to 0. We can see what would happen for each of the operators: While x == 0: The program would go through the loop only if x is equal to 0, but x is set to 10 before this. Nothing inside the loop would be performed, and only "Blast off!" would be printed. While x != 0: The program would go through the loop whenever x is NOT equal to 0. This would cause the loop to keep running while x is equal to 10, 9, 8, and so on... but then when x is equal to 0, the loop would stop running. So, we would get a countdown from 10 to 1, and then "Blast off!" but the question asks for a countdown from 10 to 0, so this answer isn't completely correct. While x >= 0: The program would go through the loop whenever x is greater than or equal to 0. This would cause the loop to keep running while x is equal to 10, 9, 8, and so on, up to and including 0. The result is a countdown from 10 to 0, then "Blast off!" which is exactly what we want to happen. While x <= 0: The program would go through the loop only if x is less than or equal to 0, but x is set to 10 before this, which is not less than or equal to 0. Nothing inside the loop would be performed, and only "Blast off!" would be printed.

SmokeyBrown:

@kekeman wrote:
If you know a person's name, there are a finite number of possibilities to obtain their credit card number. The expiration date on a card only slightly complicates the problem, given how fast modern computers can work. Which of the following is the least invasive way the merchant's website can protect credit card owners from malicious users? Asking for more personal information Calling users to verify the purchase Limiting the number of incorrect trials Recording users' IP addresses
In this question, I think "invasive" is used similarly to "invasion of privacy". We want to pick the answer that least invades the user's privacy or otherwise inconveniences them (although a little bit of inconvenience is usually a tradeoff for security) Requiring more personal information could be considered invasive, as users generally want to protect their personal information on the internet. Calling users not only requires the use of their personal phone, it could also come at an inconvenient time; I would consider this rather invasive. Limiting the number of incorrect trials does not require anything more of the genuine user; it is a way to defend against malicious attacks without greatly inconveniencing anyone with innocent intentions. Recording the users' IP addresses could be considered invasive, as IP addresses can be linked to physical addresses as well as other personally identifying information.

kekeman:

@smokeybrown wrote:
For the question about the countdown and the missing operator, you want the countdown to keep going from 10, all the way down to 0 (including 0). So, the while loop needs to keep repeating as long as x is greater than or equal to 0. We can see what would happen for each of the operators: While x == 0: The program would go through the loop only if x is equal to 0, but x is set to 10 before this. Nothing inside the loop would be performed, and only "Blast off!" would be printed. While x != 0: The program would go through the loop whenever x is NOT equal to 0. This would cause the loop to keep running while x is equal to 10, 9, 8, and so on... but then when x is equal to 0, the loop would stop running. So, we would get a countdown from 10 to 1, and then "Blast off!" but the question asks for a countdown from 10 to 0, so this answer isn't completely correct. While x >= 0: The program would go through the loop whenever x is greater than or equal to 0. This would cause the loop to keep running while x is equal to 10, 9, 8, and so on, up to and including 0. The result is a countdown from 10 to 0, then "Blast off!" which is exactly what we want to happen. While x <= 0: The program would go through the loop only if x is less than or equal to 0, but x is set to 10 before this, which is not less than or equal to 0. Nothing inside the loop would be performed, and only "Blast off!" would be printed.
Omg thank you so much I understand much better now

kekeman:

@smokeybrown wrote:
@kekeman wrote:
If you know a person's name, there are a finite number of possibilities to obtain their credit card number. The expiration date on a card only slightly complicates the problem, given how fast modern computers can work. Which of the following is the least invasive way the merchant's website can protect credit card owners from malicious users? Asking for more personal information Calling users to verify the purchase Limiting the number of incorrect trials Recording users' IP addresses
In this question, I think "invasive" is used similarly to "invasion of privacy". We want to pick the answer that least invades the user's privacy or otherwise inconveniences them (although a little bit of inconvenience is usually a tradeoff for security) Requiring more personal information could be considered invasive, as users generally want to protect their personal information on the internet. Calling users not only requires the use of their personal phone, it could also come at an inconvenient time; I would consider this rather invasive. Limiting the number of incorrect trials does not require anything more of the genuine user; it is a way to defend against malicious attacks without greatly inconveniencing anyone with innocent intentions. Recording the users' IP addresses could be considered invasive, as IP addresses can be linked to physical addresses as well as other personally identifying information.
You are such a lifesaver " Limiting the number of incorrect trials" would be the least invasive

SmokeyBrown:

Well done :) I'm happy to help

kekeman:

Do you think you can help me with a few more if not thats fine

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!