Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a complete C++ program. Initialize a vector numbers variable. Use a while to read one double at a time from the user until there

write a complete C++ program. Initialize a vector numbers variable. Use a while to read one double at a time from the user until there is no more user input. Each double should be stored in the vector numbers. After the while loop, use a for-each loop to print each number on its own line.

This is my code, I'm not sure why the result is not priting.

#include #include

using std::cin; using std::cout; using std::endl; using std::vector;

int main() { vector numbers; cout <<"Please enter a number: " << endl; double input; while (cin >> input) { for (double x{0}; x

return 0; }

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

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

When there was controversy, was it clear who had the final say?

Answered: 1 week ago