Chose the algorithm

Report a typo

A programmer needs to write a function that takes a list of numbers as input and returns the average value multiplied by 2.

He has several variants for the algorithm:

Algorithm A:

  1. calculate the mean value
  2. multiply the mean value by 2
  3. print the result

Algorithm B:

  1. calculate the mean value
  2. multiply the mean value by 2
  3. return the result

Algorithm C:

  1. calculate the mean value
  2. print the result
  3. return the result

Algorithm D:

  1. multiply the mean value by 2
  2. calculate the mean value
  3. print the result

Choose the right variant.

Select one option from the list
___

Create a free account to access the full topic