Logo/

Control Structures in Programming

Log in

Made with ScholarlyMake flashcards like these from your own notes

Control Structures in Programming

Questions and answers

23 cards
  1. Question:What is one of the functions of computer programming?

    Answer:To facilitate communication between humans and computers or machines.

  2. Question:What is a key skill to develop for working in robotics?

    Answer:Programming.

  3. Question:What does a conditional statement allow you to do?

    Answer:It allows performing different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.

  4. Question:Why is it important to differentiate between different conditional statements in robotics?

    Answer:It enables smooth control of a robot.

  5. Question:What should students be able to identify at the end of the discussion on control structures?

    Answer:The different types of control structures.

  6. Question:What should students be able to differentiate based on its structure?

    Answer:Controls.

  7. Question:List the three types of control structures in a computer program.

    Answer:1. Sequential Structure 2. Selection Structure 3. Iteration (Loop) Structure.

  8. Question:What does a sequential structure show?

    Answer:A process, a series of steps, or an order of events, executed line-by-line in the same order they appear in the program.

  9. Question:What is a selection structure?

    Answer:A programming feature that performs different processes based on whether a boolean condition is true or false, using relational operators to test conditions.

  10. Question:Define looping in programming.

    Answer:Looping can be defined as repeating the same process multiple times until a specific condition is satisfied, also known as iteration.

  11. Question:What is the function of conditional control structures?

    Answer:To make conditions or expressions that evaluate to either true or false, mainly used to determine program flow through if statements and while loops.

  12. Question:What does an 'if' conditional statement do?

    Answer:It executes any statement inside the brackets if the conditional statement is true; if false, the program skips over the statement.

  13. Question:What is an 'if else' conditional statement?

    Answer:An if statement can have an else clause, which handles what should be done if the if statement is not true, allowing execution of different blocks of code based on the condition.

  14. Question:Describe a 'while' loop statement.

    Answer:A while statement repeats a block of code as long as the condition is true, executing the code within the curly braces repeatedly.

  15. Question:What is the 'if else if' conditional statement?

    Answer:It checks multiple conditions sequentially, executing a block of code based on the first true condition, with an optional else statement at the end.

  16. Question:What is the purpose of a 'for' loop statement?

    Answer:It is used to execute a block of code a specified number of times when the number of iterations is known beforehand.

  17. Question:What are the three parts of a 'for' loop statement?

    Answer:1. Initialization 2. Condition 3. Increment/Decrement.

  18. Question:What are the five control structures discussed in the lesson?

    Answer:1. If Conditional Statement 2. Else Conditional Statement 3. While Loop Statement 4. If Else If Conditional Statement 5. For Loop Statement.

  19. Question:What is the function of a conditional control structure?

    Answer:To evaluate expressions or conditions that affect program flow and decision-making.

  20. Question:What is the outcome of using the else clause in an if statement?

    Answer:It specifies what should be done if the if statement evaluates to false.

  21. Question:What happens in a while loop if the condition becomes false?

    Answer:The loop terminates and the program continues with the next statement following the loop.

  22. Question:What is the significance of relational operators in selection structures?

    Answer:They are used to test conditions within the selection structure.

  23. Question:What are the three programming structures mentioned?

    Answer:Sequential Structure, Selection Structure, Iteration (Loop) Structure.