Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help in C++ I have no idea from where to begun tho. All I have is the instructions and an output of the

I need help in C++ I have no idea from where to begun tho.

All I have is the instructions and an output of the actual code that's all. Plz Help!!

image text in transcribed

image text in transcribed

Objectives: Practice getting input from the user . Practice using loops and conditions Practice using arrays Assignment: Create a program that asks the user for how many sides their shape has and tell them what their shape is based on that. There must be three possible options: 3 (triangle), 4 (quadrilateral), and 5 (pentagon). You should create a corresponding array based on the shape sides. Once the shape is determined, gather the length of all the sides and place them in the array. Once done, total the sides in a loop to determine the perimeter and display that information to the user. Details: Loop on side input -- check if there's a valid number of sides (3-5) o If there's not, display an error message and ask again Loop through the number of sides to build the array O ALSO Check if the side length is valid (>0) Loop if it's not, asking again Loop until valid side length is entered Loop through completed array 0 This should be separate from the building array Total the sides as you move through the array Once done, display to the user Example Execution: How many sides does your shape have? 6 That's not a valid shape here. Try again. How many sides does your shape have? 4 You have a quadrilateral! What is the length of side 1: 3 What is the length of side 2: 0 I'm sorry, that's not a valid length. Try again. What is the length of side 2: 4 What is the length of side 3: 3 What is the length of side 4: 4 Your perimeter is: 14

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