CS 120 M2 Coding Challenge: Recursion

Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due

M2 Coding Challenge: Recursion

Computer Science 120—Assignment

Instructions:

For each of your chosen programs:

• Use pseudocode to plan out the program.

• Write the code for the program and use whitespace to make it easier to read.

• Run the program and check for errors.

• List any corrections you made to your original plan at the end of the program using pseudocode.

• Cite where and how you used generative AI to assist you as a comment at the end of your program.

• Save the program using an appropriate name.

Here are some options for how you may use generative AI to assist you with this assignment:

Þ After you have done your own work, compare it to an AI generated solution by asking it to break down the same problem using computational thinking.

o Evaluate the work of the AI for its approach, style, efficiency, and effectiveness. What did it do differently and what advantages/disadvantages are there to solving the problem in this way?

Þ If you are getting errors you cannot troubleshoot on your own, ask an AI to identify these issues for you.

Always cite where and how you used generative AI as a comment at the end of your program. Only use AI generated code that you fully understand and can confidently modify for your own needs.

Complete BOTH of the following programs:

Program 1: Tribonacci

Tribonacci numbers are a sequence of numbers where each number is the sum of the three preceding ones.

Write a program to recursively calculate a given Tribonacci number.

Example output:

Program 2: Power Function

Write a program to recursively calculate the power of a given base raised to an exponent.

Example output:

Upload your two Python code files in ManageBac



发表评论

电子邮件地址不会被公开。 必填项已用*标注