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 : Functions with Value Parameters Problem : 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 VF gle dot. On the second, there are dots. On the third, there are dots, and on the fourth there are dots. Return the number of dots that exist in the whole pentagon on the Nth iteration. Sample inputoutput: Enter an integer: The number of dots in a pentagonal shape with iterations is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
