Question
Write the complete C++ program that implements the following program, as if you were turning this in for homework. Your program should have a commented
Write the complete C++ program that implements the following program, as if you were turning this in for homework. Your program should have a commented header (your name, etc), comments within the program and a well-built display for the output. Dont forget the pre-processor commands. Define an array called nums with a maximum of 20 integers, and fill the array with numbers, received from the keyboard (prompt for the numbers.) In this program, exactly 20 integers will be input (no need to use vectors). Then write a function named split() that accepts the array, along with two other arrays called positive and negative. This function places all zeros and positive numbers into positive and all negative numbers into negative. Finally, back in the main, have your program only display the values in the array positive and negative. Do not use vectors in any of your code. The output should look like the following example. You will need to account for in your code that the arrays positive and negative will not necessarily contain 20 numbers. The positive numbers are: 0 4 6 2 100 The negative numbers are: -1 -5 -99 -100 -2
How do you do this using arrays only?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started