Topic 3: Producing robust programs

Cards (20)

  • What are the two possible outputs for the given condition in the study material?
    "User1" or "Access denied"
  • What is robust code designed to prevent?
    It is designed to prevent the program from crashing due to unexpected user input.
  • Why does the pseudocode for calculating an average crash for some inputs?
    Because the algorithm needs to be amended to handle unexpected user inputs.
  • What is the first input prompt in the pseudocode for calculating an average?
    "Enter score for Round 1:"
  • What happens if both scores entered are zero in the pseudocode?
    The average score is printed as 0.
  • What does the pseudocode print if the scores are not both zero?
    It prints the average score calculated as \( \frac{x + y}{2} \).
  • What is the first input prompt in the algorithm for carpeting a room?
    "Enter room length:"
  • What condition is checked regarding the room length in the carpeting algorithm?
    If the room length is greater than 3.5.
  • What is the consequence if the room length exceeds 3.5 in the carpeting algorithm?
    It prints "Carpet not wide enough."
  • What is the purpose of the rewritten algorithm for carpeting?
    To ensure the longest dimension is entered as the length.
  • What is the second input prompt in the rewritten carpeting algorithm?
    "Enter room width:"
  • What happens if the room width is greater than 3.9 in the rewritten algorithm?
    It prints "Carpet not wide enough."
  • What should an algorithm do if a student gets an A* in GCSE Maths?
    • Advise the student to consider taking Further Maths at A Level.
  • What should an algorithm do if a student gets an A in GCSE Maths?
    • Advise the student to consider taking Maths at A Level.
  • What should an algorithm do if a student gets a B in GCSE Maths?
    • Advise the student to consider taking Maths at AS Level.
  • What should an algorithm advise if a student does not get an A*, A, or B in GCSE Maths?
    • Advise the student not to continue with Maths.
  • What are the two methods for writing complex selection statements mentioned in the study material?
    • Case statement
    • Nested if statement
  • What is the multiplication factor used for calculating the length of carpet required?
    1. 02
  • What is the purpose of checking if the room length is less than the room width in the rewritten algorithm?
    To ensure the longest dimension is correctly assigned as the length.
  • What error is present in the original carpeting algorithm?
    The algorithm does not check if the longest dimension is entered as the length.