QUESTION: In American football, teams compete for field space and score points in two different ways: through the touchdown, which can be worth 6 or 7 points and by kicking the goal, which is worth 3 points. When a team enters the opponent's touchdown area, it immediately scores 6 points and is entitled to a goal kick that is worth 1 extra point. Finally, game scores are set up by the possibility of making 3, 6 or 7 points, which means that some scorecards are impossible to do like 5, 13 or 22 points. Your task will be to have a collection of a team's flags (array) and to identify if the placards are possible or not.
Ex: 17 → Invalid score, 10 → Invalid score
The conditions that I have achieved were several, but because it is a challenge I believe the code is not great, so I did not put all of them:
I declared an array with the placemarks. The program just needs to say whether they are valid placers or not.
int placarNY[10] = {17, 26, 22, 10, 21, 18, 15, 24, 35, 19};
for(int i = 0; i < 10; i++){
if((placarNY[i]%3 == 0) ||(placarNY[i]%7 == 0)||(placarNY[i]%10 == 0)){
cout << placarNY[i] << " <- placar valido !" << endl;
}else{
cout << placarNY[i] << " <- placar invalido !" << endl;
}
}