[SOLVED] CS104 Homework 07

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

Please check the code given below. Please list down three things can go wrong here. Modify the code so that it can handle those errors and keeps on asking for the proper inputs until submitted.

Please implement a recursive function pow which accepts an integer base and exponent and returns the base raised to that exponent. Example: pow(3, 4) returns 81.

Please implement a recursive function sum_recursively that takes a list and sums its content. Example: sum_recursively([19, 5, 6]) returns 30.

Please check the Luhn algorithm implementation from Recursion Lecture Notes (slides 67-69). Please implement 10 assertions that assesses the functions and special cases in this implementation.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.