Question: What does this error message mean? expected primary expression before int Also, how do i get the program to repeat the numbers that were entered
What does this error message mean? "expected primary expression before int"
Also, how do i get the program to repeat the numbers that were entered by the user back to me?
this is my code below:
// This program accepts a series of positive numbers // This code was last modified on 2/16/2020
#include
using namespace std;
void welcome(); int entrySubmission(int numbers); void acceptsNumbers(int); void goodbye();
int main() {
welcome();
entrySubmission(int numbers);
acceptsNumbers(int);
goodbye();
return 0;
}
void welcome() { cout << "Welcome to the Positive Number Program!" << endl; cout << "" << endl; cout << "In this program you will enter a series of positive numbers "; cout << "When you have completed entering your numbers, enter a "; cout << "to end the end the entry portion of the program" << endl; cout << "" << endl; }
int entrySubmission(int numbers) //need loop to enter numbers until zero { cout << "Please enter a series of positive numbers. "; cout << "Please enter a zero when you have completed your entries." << endl; cin >> numbers;
while (numbers < 0) { cout << "Negative numbers are not allowed. Please enter a positive number." << endl; cin >> numbers; }
while (numbers > 0) { cout << "Please enter your next positive number." << endl; cin >> numbers; }
if (numbers == 0) { cout << "The numbers you entered are" << numbers << endl; return; } }
void acceptsNumbers(int) { if (numbers <= 10) { cout << "10 or fewer positive numbers were entered" << endl;
else cout << "More than 10 positive numbers were entered" << endl; } }
void goodbye() { cout << "Thank you for using the Positive Number Program! Goodbye!" << endl;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
