Question: Write an algorithm that determines how many positive in - tegers evenly divide the positive integer n . The algorithm should return the number of

Write an algorithm that determines how many positive in-
tegers evenly divide the positive integer n. The algorithm
should return the number of divisors (not the actual divisors).
For example, 4 has three divisors: 1,2,4. Call the algorithm
numberOfDivisors.Suppose that Jane does different activities during the various
seasons of the year. When it is fall, she goes bike riding, but
only if the temperature is at least 50F. If the temperature is
not warm enough in the fall, she reads a book instead. During
the winter, Jane always plays in the snow. In both the sum-
mer and spring, she goes running unless the temperature ex-
ceeds 70F. If the temperature is over 70 and not over 90F,
Jane walks around the lake. When the temperature gets above
90F, the only activity she can do is swimming. Write an
algorithm that returns the activity that Jane should carry out
based on the season and temperature (a real number).
A family rolls a standard pair of fair, six-sided dice to help
determine which person will do the dishes on Monday night.
If the sum of the digits on the pair of dice is odd, then Mom
automatically has to do the dishes. A roll of the dice in which
the sum of the digits is divisible by 4 means that either Dad
or Brother Joe will do the dishes, depending on whether the
digits are the same (Dad) or different (Brother Joe). All other
rolls of the dice will appoint Sister Sue to do the dishes. Write
an algorithm to display the name of the person on dishes duty
for Monday night. The algorithm should accept as input two
values, which are the the numbers of dots on the top faces of
the pair of dice.
Write an algorithm that determines how many

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!