Question: Six doubles are read from input as variables distance 1 to distance 6 . Declare a vector of 1 2 doubles named swimmingDistance. Initialize the

Six doubles are read from input as variables distance1 to distance6. Declare a vector of 12 doubles named swimmingDistance. Initialize the elements at the even indices with the value 0 and the odd indices with the variables distance1 to distance6 in the order the input doubles are read.
Ex: If the input is 18.188.6211.3318.0222.19.9, then the output is:
018.1808.62011.33018.02022.109.9
Note: Index 0 is considered an even index.

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