Question: c++ please. Let's create a new data type called umbrella with two member variables: struct umbrella { float length; string color; Write a program called

c++ please.

c++ please. Let's create a new data type called umbrella with two

Let's create a new data type called umbrella with two member variables: struct umbrella { float length; string color; Write a program called lab8_umbrellas.cpp that includes this data type (struct) definition before the main() method. 1. Inside main(), declare a static array that contains three umbrellas. 2. Write a for loop to read in values from the user for the length and color members of each umbrella. You do not need to check for valid user input. 3. Write a for loop to find the index of the longest umbrella. 4. Output the index, length, and color of the longest umbrella Example output (user input is highlighted): Enter length for umbrella 0: 5.3 Enter color for umbrella 0: red Enter length for umbrella 1: 7.9 Enter color for umbrella 1: green Enter length for umbrella 2: 4.1 Enter color for umbrella 2: black The longest umbrella (index 1) has a length of 7.9 and is green

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