Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Question

Why do you want to leave your current job?

Answered: 1 week ago

Question

Find the integral. 9z3z - 7 dz

Answered: 1 week ago

Question

How would we like to see ourselves?

Answered: 1 week ago