#include <iostream>
#include <cmath>
usingnamespace std;
void validset(int,int,int);
int main()
{
int x,y,z;
char answer;
do {
cout << "Type in the first score" << endl;
cin >> x;
cout << "Type in the second score";
cin >> y;
cout << "Type in the third score";
cin >> z;
validset (x,y,z);
cout << "Type c to continue; s to stop";
cin >> answer;
}while (answer == 'c');
return 0;
)
void validset(int x, int y, int z)
{
if (x < 0 || x > 300)
cout << "The group is invalid";
elseif (y < 0 || y > 300)
cout << "The group is invalid";
elseif (z < 0 || z > 300)
cout << "The group is invalid";
else
cout << "The group is valid";
return 0;
}
Line 13,23: These should be curly braces, not parens. General ruile: expressions are surrounded by parens. statement blocks are surrounded by curly braces.
Line 25: This should be a curly brace, not a close paren.
Line 27,37: Again these should be {}, not ()
Line 36: Your can't return 0 on a void function. Since there is no meaningful return value, remove line 36.
#include <iostream>
#include <cmath>
usingnamespace std;
void validset(int,int,int);
int main()
{
int x,y,z;
char answer;
do (
cout << "Type in the first score" << endl;
cin >> x;
cout << "Type in the second score";
cin >> y;
cout << "Type in the third score";
cin >> z;
validset (x,y,z);
cout << "Type c to continue; s to stop";
cin >> answer;
) while (answer == 'c');
return 0;
)
void validset(int x, int y, int z)
(
if (x < 0 || x > 300)
cout << "The group is invalid";
elseif (y < 0 || y > 300)
cout << "The group is invalid";
elseif (z < 0 || z > 300)
cout << "The group is invalid";
else
cout << "The group is valid";
return 0;
)