/* * @file sp12hw1.cpp * @brief Progarm will Create a recursive function to draw * this pattern, given a maximum number of stars * * @remarks * Course: Computer Science 2114, Spring 2015 * Assignment #: Hw 12 * Due Date: Tuesday, April 14 * Instructor: Mr. Jason L. Causey * * @author * @date Tuesday, April 14 */ # include using namespace std; void drawpattern(int width, int startcol); void printStar(int width,int startcol); int main() { int stars = 0; // Stores number of stars to start pattern. // Get pattern start number from user. cout << "Enter number of stars to print in pattern: "; cin >> stars; drawpattern(stars, 0); //return 0; return system("pause"); } void printStar(int width, int startcol) { if(startcol==0) { if(width==0) { cout< 0 ){ // Print first in series. printStar(width, startcol); // Call next series. drawpattern(width/2, startcol); // Move to next column. drawpattern(width/2, startcol+(width/2)); // Print last in series. printStar(width, startcol); } }