Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a function geoshape that takes input variable sideCount, specifying the number of sides on a geometric figure, and displays output shape according to following
Write a function geoshape that takes input variable sideCount, specifying the number of sides on a geometric figure, and displays output shape according to following table. Your script should also catch "Invalid" input and ask for a valid input. You should also copy and paste the script the space below (8 pts) 7. Value of Less than 3 shape Not a shape' Triangle 'Quadrilateral' Pentagon' 4 Greater than 5 Other (8 pts) 8. Write a script newvector that will ask for input vector, a, and then using a while loop, and create a new vector, b, of the same length that satisfy the following condition The item b at the index i should be cube ofthe item a(i) IF a() is less than or equal to 4. If a(i) is greater than 4, then the item b at that indexi should be 0 So running newvector for the input [-10, 2, 5, 13, 4, 0, 9, 15, -7] should give b- [-1000, 8, 0, 0, 64, 0, 0, 0, -343]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started