Answered You can hire a professional tutor to get the answer.

QUESTION

I have an array of char base. I am trying to look to see if the last item in the array is equal to a that character 'o' if it is not, then I want to...

i would want it to convert to ---ooo

if my array is oooooo. then nothing should happen.

# include <iostream>

using namespace std;

int main ()

{

 const int size = 6;

 char taken = 'o';

 int userchoice;

 char arrayGame[size] = {'-', '-', '-', '-', '-', '-',};

 cout << "how many in your array? ";

 cin >> userchoice;

 for( int i=0; i< userchoice ; ++i){

   if (arrayGame[6] != taken){

   arrayGame[6] = taken; 

   }

   cout << arrayGame[i] << " ";

 }

 cout << endl;

return 0;

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question