Timing the selected scoring path

A scoring program evaluates if check() then fast() + 6 else slow() + 6 using a selective conditional and strict addition. For this run, check() returns false and takes 2 ms; fast() returns 9 and would take 4 ms; slow() returns 14 and takes 11 ms. Calls execute sequentially. Ignore all other costs. Find the returned score, an integer, and the evaluation time in ms. Give both answers to zero decimal places.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Evaluation Strategies Questions: