You can run an algorithm like you can run code. (1 point)ResponsesTrueTrueFalseFalseQuestion 2Which of these scenarios is BEST suited for a switch case statement?(1 point)Responsesdetermining whether it's raining or notdetermining whether it's raining or notchoosing whether a number is odd or evenchoosing whether a number is odd or evendetermining the rate for a ferry based on vehicle typedetermining the rate for a ferry based on vehicle typechoosing a random number between 1 and 100choosing a random number between 1 and 100Question 3Which of these is NOT a factor in improving an algorithm’s efficiency?(1 point)Responsesmemorymemorytime to runtime to runnumber of loopsnumber of loopsnumber of lines of codenumber of lines of codeQuestion 4Which type of loop is BEST suited for displaying the names of 10 students in a class from a file?(1 point)Responseswhile loopwhile loopdo...while loopdo...while loopfor loopfor loopswitch case statementswitch case statement

1 answer

Here are the responses to your questions:

Question 1: You can run an algorithm like you can run code.
Response: True


Question 2: Which of these scenarios is BEST suited for a switch case statement?
Response: determining the rate for a ferry based on vehicle type
(Switch case statements are typically used for multi-way branching, such as selecting among multiple distinct options based on a specific value, which fits this scenario.)


Question 3: Which of these is NOT a factor in improving an algorithm’s efficiency?
Response: number of lines of code
(The number of lines of code does not necessarily correlate with the efficiency of an algorithm. Efficiency is more closely related to time complexity, memory usage, and the number of loops.)


Question 4: Which type of loop is BEST suited for displaying the names of 10 students in a class from a file?
Response: for loop
(A for loop is ideal for iterating a known number of times, such as when you have a fixed count like 10 students.)


Let me know if you need further assistance!