Hi- Okay so this is the code below and the instructions are in part 4 and after
ID: 3624846 • Letter: H
Question
Hi- Okay so this is the code below and the instructions are in part 4 and after part 4. It's looks long but it's VERY SIMPLE program and VERY EASY. Make sure it is compiled and run in C language only. NO java or C++ :)#include <iostream>
using namespace std;
#define SIZE 9
void fillWithDashes(char board[]);
void printAsBoard(const char board[]);
void printInLine(const char board[]);
int main() {
// Part 1 - Compile and run
char board[SIZE] = {'X', '-', '-', 'O', 'X', 'O', 'O', '-', 'X'};
cout << endl << "C++ template for CS102" << endl << endl;
// Part 2 - Complete the body of the following functions
printInLine(board);
fillWithDashes(board);
printInLine(board);
// Part 3 - Complete the body of the following function.
printAsBoard(board);
// Part 4 - Read carefully and complete accordingly.
/*
* Create a loop that for each cycle asks for user input.
* The input is 1 <= number <= 9.
* In response to the user input the array is modified in such a way
* either an 'X' or an 'O' are appropriately inserted in it.
* After each modification, the content of the array must be displayed
* using the printAsBoard function.
*/
return 0;
}
/*
* Modify the array in such a way each element is a dash character.
*/
void fillWithDashes(char board[]) {
}
/*
* Print the content of the array in this format: X - - O X O O - X .
* Between each character there must be a white space.
* After the last character there must be a 'newline' character.
*/
void printInLine(const char board[]) {
}
/*
* Print the content of the array as a 3x3 board:
*
* X - -
* O X O
* O - X
*
* After the last character there must be a 'newline' character.
*/
void printAsBoard(const char board[]) {
}