Question: Chapter 6 : Functions with Value Parameters Problem 3 : Pentagonal Number Write a function that takes a positive integer and calculates how many dots

Chapter 6: Functions with Value Parameters Problem 3: Pentagonal Number Write a function that takes a positive integer and calculates how many dots exist in a pentagonal shape around the center dot on the Nth iteration. In the image below you can see the first iteration is only a sin VF19 gle dot. On the second, there are 6 dots. On the third, there are 16 dots, and on the fourth there are 31 dots. Return the number of dots that exist in the whole pentagon on the Nth iteration. Sample input/output: Enter an integer: 8 The number of dots in a pentagonal shape with 8 iterations is 141

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 Programming Questions!