/* * File: template.cpp * Description: This is a template program for CS102 Fall 09 class. * This template is divided in four parts which constitute Lab 10. * Created: Sunday November 8, 2009 * Author: Marco Bernasconi (mberna7@uic.edu) * * Modified by: INSERT HERE YOUR NAME!! */ #include 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[]) { }