While divisor num do steps 1ci 1cii i if num mod

  • Alexander College
  • CPSC 111
  • anmolsandhu7766
  • 6
  • 100% (2) 2 out of 2 people found this document helpful

This preview shows page 5 - 6 out of 6 pages.

While divisor < num do steps 1.c.i – 1.c.ii i. If num mod divisor is 0 do step 1.c.i.1 1. Add divisor to sum ii. divisor = divisor + 1 d. if sum > num do step 1.d.i i. return true e. return false 1 point for reading input 3 points for a correct repetition structure to go through all potential divisors 1 point for checking divisibility 1 point for adding to sum 2 points for output
CPSC111BV-Introduction to Computing: Fall 2019 Midterm Exam 2 – Muntaseer Salahuddin b) [12 points] Write the body of the following function. You may create other functions to solve the problem if necessary. You do NOT have to write any other code to demonstrate the usage of the function.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture