I have not worked with the debugger at all and I have a assignment to debug a program.
I don't want just the answer I need help using the debugger.
Correct the Logical errors in the code so that the output of the program appears as such:
*
**
***
****
*****
Code:
/******************************************************************
* Programmer: [Rodney Garner]
*
* Date: [03/11/2011]
*
* Course: COMP 220
*
* Assignment: Identification and correction of logical errors
*
* Description: this program prints a triangle with a base of five asterisks
*
* Output: screen - displays a triangle
*
********************************************************************/
#include <iostream>
int drawBar(int);
int main()
{
std::cout << std::endl << "Let's Draw a triangle!\n";
//determine how many lines will be drawn
int triangleBase = 0;
//draw the triangle
for (int i = 0 ; i >= triangleBase ; i--) {
drawBar(i);
}
return 0;
} //end main
int drawBar(int barSize) {
//draws a line of asterisks
//the number of asterisk drawn equals barSize
int theCounter = 0;
while (theCounter >= barSize) {
theCounter--;
std::cout << '*';
}
std::cout << '\n';
return 0;
} //end drawBar