Question: Jump to level 1 Four doubles are read from input as variables distance 1 to distance 4 . Declare a vector of four doubles named

Jump to level 1
Four doubles are read from input as variables distance1 to distance4. Declare a vector of four doubles named
swimmingDistance. Initialize the elements with the variables distance1 to distance4 in the order the input doubles are read.
Ex: If the input is 5.7,22.19,11.8,19.12, then the output is:
5.722.19,11.8,19.12
double distance4;
unsigned int i;
cin >> distance1;
cin >> distance2;
cin >> distance3;
cin >> distance4;()/(*)
Your code goes here(*)/()
for (i =0; i swimmingDistance.size(); ++i){
cout
swimmingDistance.at(i)"";
}
cout endl;
return 0;
Jump to level 1 Four doubles are read from input

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!