Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python, For this assignment, I would like for you to rewrite the code from the Creating a Sequence Using R ecursion (No While Loops

In python,

For this assignment, I would like for you to rewrite the code from the Creating a Sequence Using Recursion (No While Loops or For Loops) and create a module (a 50 pt reduction for not using modules) for the following sequences:

Square Numbers

Fibonacci Numbers

Triangular Numbers

Hexagonal Numbers

Also for this program, allow the user to:

State which list to create

State how many elements that they want in the list

Allow the user to state the number that starts generating the Square Numbers and Triangular Numbers.

Allow the user to decide if they would like to create a new sequence.

Be sure to include comments with at least your name, and a brief description of the code. Below is the example run of the program.

For the Fibonacci sequence, assume that you are starting with 0 and 1 in your list.

The program will run the same, but in this case you will have at least 2 separate files for functions the create your sequence and your main program.

image text in transcribed

1. Square Nimbers 2. Fibonaci Numbers 3. Triangular Numbers 4. Hexagonal Numbers Ase far this preghn, allaw the user tex - State which list to create - State how many elemernts that they wart in the list - Allow the ueer to state the numher that starts gererating the square Numaens and Triangular Numares, - Alow the user to decide if they would like to create a new sequence. Be sure to include comments with at least your name, and a brief description of the code. Pelous is the examale run of the program Sample Rums: vhioh seguence? S1,F1, s bod leag ta the Hat? 5 Woald you like to yun this program again? (X or bl Y valeh aeguenee 13,E, I) F ad lang in the 118t? ? [0,1,1,2,3] hould you like to Yun this pyogram again? (Y or bl Y ase 1 ane is the [1,sh,1] that to the starting nunber? 1 [1.0,9.6,6.0,10.0,15.0] Nould you like to zun thsm pregram ngains (I er a) I Hint: Use this website, to aid you in creating an algorithm far the sequences above. For the Fibonocoi sequence, assume that you are starting with 0 and 1 in your list. pts|

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

How do you add two harmonic motions having different frequencies?

Answered: 1 week ago