So I'm taking an intro to programming topics using C++. I have been using Xcode (project type: C++ tool) and TextEdit using the g++ compiler in the terminal concurrently.
I have yet to receive my textbook and I'm starting to feel a little behind. For our homework this weekend we have to create square by defining the boarder and character type.
The coding style should look like:
int main()
{
// Define variables border and answer as type char
// Define variable isSolid as type bool
// Ask if the square is solid and save to the variable answer
// based on answer, assign isSolid to true or false
// Ask second question to get a character border to draw
// Draw five lines based on the value of isSolid and the border character
return 0;
}
While the output may look like:
Draw a 5 by 5 square: is it solid? (y/n) y
Give me the character to draw: 1
11111
11111
11111
11111
11111
Press Q to Exit: q
Draw a 5 by 5 square: is it solid? (y/n) n
Give me the character to draw: a
aaaaa
a a
a a
a a
aaaaa
Press Q to Exit: q
Any help would be appreciated.
Thanks!
I have yet to receive my textbook and I'm starting to feel a little behind. For our homework this weekend we have to create square by defining the boarder and character type.
The coding style should look like:
int main()
{
// Define variables border and answer as type char
// Define variable isSolid as type bool
// Ask if the square is solid and save to the variable answer
// based on answer, assign isSolid to true or false
// Ask second question to get a character border to draw
// Draw five lines based on the value of isSolid and the border character
return 0;
}
While the output may look like:
Draw a 5 by 5 square: is it solid? (y/n) y
Give me the character to draw: 1
11111
11111
11111
11111
11111
Press Q to Exit: q
Draw a 5 by 5 square: is it solid? (y/n) n
Give me the character to draw: a
aaaaa
a a
a a
a a
aaaaa
Press Q to Exit: q
Any help would be appreciated.
Thanks!