Lines 17,33,44: It doesn't look like you moved these functions outside main() at all.
They're still nested.
Lines 17,33,44: The function prototypes for these functions are declared
void
.
You've omitted the type on the function definitions. They must agree. Your compiler should have warned you about this. However, it may not have since these functions are out of place. For example, Line 17 is interpreted as a function call, not a function definition. Lines 18-32 are simply interpreted as a block of main(). Same with your other two functions.
Lines 17,33,44: Should not have ; after the function header once you move them.
Lines 58-63 are extraneous and should be removed.
Lines 28,41,55: The second newline has the wrong escape character.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#include <cstdlib>
#include <iostream>
using namespace std;
// program will print "BXR" in block letters using asteriks
//Fuctions used . . .
void printB(); //the following does not return a int to the main function
void printX();
void printR();
int main()
{
printB(); // Print a B onto the screen
printX(); // Print an X onto the screen
printR(); // Print an R onto the screen
system("pause");
return 0;
} //End main
void printB()
{
cout << " *******\n"; //the block "B" asterisk
cout << " *******\n";
cout << " ** **\n";
cout << " ** **\n";
cout << " *******\n";
cout << " *******\n";
cout << " ** **\n";
cout << " ** **\n";
cout << " *******\n";
cout << " *******\n/n";
} //end printB()
void printX()
{
cout << "*** ***\n"; //the block "X" asterisk
cout << "*** ***\n";
cout << " *** ***\n";
cout << " ***\n";
cout << " *** ***\n";
cout << "*** ***\n";
cout << "*** ***\n/n";
} //end printX
void printR()
{
cout << " *******\n"; //the block "R" asterisk
cout << " *******\n";
cout << " ** **\n";
cout << " ** **\n";
cout << " *******\n";
cout << " *******\n";
cout << " ** **\n";
cout << " ** **\n";
cout << " ** **\n";
cout << " ** **\n/n";
} //end printR
|
*******
*******
** **
** **
*******
*******
** **
** **
*******
*******
/n*** ***
*** ***
*** ***
***
*** ***
*** ***
*** ***
/n *******
*******
** **
** **
*******
*******
** **
** **
** **
** **
/nPress any key to continue . . . |
For extra credit, try printing the letters beside each other.