Need help on assignment

So i have an assignment with the instructions:
Implement a program that verifies if character '!' exists within N provided characters.
The program must read the amount N of characters to be read from the user.
Afterwards, all the N characters need to be read and stored in an array.

These are examples of what it must do,
The number of values is 11 and the 11 values are H e l l o ! W o r l d, must have a result of 1, which means "true".

The number of values is 6 and the 6 values are / ( % $ - ? must have a result of 0, which means "false".

I have all the functions except the processing one, meaning the one that must have the result of the number of ! characters and the "true" or "false"
Last edited on
Seeing your code would be helpful
#include <iostream>
using namespace std;

int askValues(char cArrBoxes[20])
{

int iAmount;
int iCounter;

cin >> iAmount;

for(iCounter = 0; iCounter < iAmount; iCounter++)
{
cin >> cArrBoxes[iCounter];
}

return iAmount;

}

int checkValues(int cArrValues[20], int iAmount)
{
int iAccum = 0;
int iCounter;

//here is where im stuck and dont know what to write
}

void displayResult(int iNumber)
{
cout << iNumber << endl;
}

int main()
{
int iSize;
char cArrValues[20];
int iCheck;

iSize = askValues(cArrValues);

iCheck = checkValues(cArrValues, iSize);

displayResult(iCheck);

return 0;
}
Last edited on
Topic archived. No new replies allowed.