In this lab, you complete a partially written C++ program that includes two functions that require a single parameter. The program continuously prompts the user for an integer until the user enters 0. The program then passes the value to a function that computes the sum of all the whole numbers from 1 up to and including the entered number. Next, the program passes the value to another function that computes the product of all the whole numbers up to and including the entered number. The source code file provided for this lab includes the necessary variable declarations and the input statement. Comments are included in the file to help you write the remainder of the program. #include #include void sums(int); void products(int); using namespace std; int main() { double number; cout << "Enter a positive integer or 0 to quit: "; cin >> number; while(number != 0) { // Call sums function here // Call products function here return 0; } // End of main function // Write sums function here // Write products function here
In this lab, you complete a partially written C++
The program continuously prompts the user for an integer until the user enters 0. The program then passes the value to a function that computes the sum of all the whole numbers from 1 up to and including the entered number. Next, the program passes the value to another function that computes the product of all the whole numbers up to and including the entered number.
The source code file provided for this lab includes the necessary variable declarations and the input statement. Comments are included in the file to help you write the remainder of the program.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images