//This will create the ArrowHead
// This will create the top section of the arrow , 1 Draw char top row followed by +2 each following row
for (int height = 1; height <= headWidth; height += 2)
{
//Going from bottom up minusing 2 spaces as it goes
for (int spaces = headWidth; spaces > height; spaces -= 2)
{
//output spaces
cout << " ";
}
for (int spaces = 0; spaces < height; spaces++)
{
cout << drawChar; //Prints Symbol
}
cout << endl;
}
// This will create the tail of the arrow
//Arrow Tail
for (int r = 0; r < tailLength; r++)
{
for (int c = 0; c < tailWidth; c++)
{
//If statement to declase what to print
if (r == tailLength / 2)
{
cout << ' ';
}
else
{
cout << drawChar;
}
}
cout << endl;
}
return 0;
}
The tailLength is wrong because the headLength is wrong. headLength = headWidth / 2 + 1.
Then the code to print the tail is too complicated. It should be like the code that prints the arrow. Figure out how many spaces and how many drawChars to print, then print them. The tail should be centered under the head. The tail is headWidth-tailWidth characters less than the head. Half of that difference should be on the right and half on the left, so the number of spaces to print is (headWidth-tailWidth)/2