Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Part A, you will create constants and functions related to the board size. Put the constants and function prototypes in a file named BoardSize.h

image text in transcribedimage text in transcribed

In Part A, you will create constants and functions related to the board size. Put the constants and function prototypes in a file named BoardSize.h and the function implementations in a file named BoardSize.cpp. Throughout this course, make sure that you use exactly the specified file names, which are case sensitive. Here, B and S are uppercase and the remaining letters are lowercase. By the end of Part A, you will have functions with the following prototypes: char getRowName (int row); char getColumnName (int column); Perform the following steps: 1. As the first line in BoardSize.h and every other header (. h) file for the rest of the course, put the following line: #pragma once This line tells the C++ compiler to only compile this file once even if it happens to be #included multiple times: 2. In BoardSize.h, define BOARD_SIZE and BOARD_CELL_COUNT as integer constants. BOARD_SIZE should have a value of 7 and BOARD_CELL_COUNT should have a value of BOARD_SIZE * BOARD_SIZE. 3. In BoardSize.h, copy in the function prototypes shown above. You are now finished BoardSize.h. 4. Near the top of BoardSize.cpp, add the following command: #include "BoardSize.h" 5. Add an implementation for the getRowName function that returns the name character for that row. For example, if 0 is passed in as the row parameter, then the name character is 'A', so Achould he returned 5. Add an implementation for the getRowName function that returns the name character for tha row. For example, if 0 is passed in as the row parameter, then the name character is 'A', so 'A should be returned. Hint: You can use mathematical operators, such as addition and subtraction, on char The uppercase letters form a sequence, so you can add 'A' + 2 and get 'C'. The same kinds of operations apply to lowercase letters and to digits. 6. Add an implementation for the getColumnName function that returns the character name of that column. Hint: Column names are chars starting with '0', and '0' + 3 == '3'. 7. Test your BoardSize module using the TestBoardSizel.cpp program provided. You wi also need the TestHelper.h and TestHelper.cpp files. Note: All the test programs for the game will use the same TestHelper.h and TestHelper.cpp files. Note: For additional information on compiling programs consisting of multiple files, please consult link

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

2. Show the trainees how to do it without saying anything.

Answered: 1 week ago