I know this will be a pretty easy one to solve but it eludes me for the time being and since im really up fulltime on workload right now i havent been able to sit down much and look it over carefully. For one assignment I was asked to create a program that given a string of N number of characters (meaning it could be any length the user desires) that it be placed centered on screen with some symbol character (such as ***) covering either side of it where empty spaces would be. Should the text be too big to fit in one line, then the program should sub divide it and print it in as many lines necessary. Now for this problem specifically imma be working with the assumption that the max number of chars that can the user can input per line are 80 (thats the min default for the linux console screen) ... This all would be real easy were I to use for's or while's but the purpose of this assignment is to create the program using the recursive technique..meaning creating a class with different methods inside that call each other, and one of them has to keep calling itself under an if condition to keep itself in aloop until that condition is met. Maybe I've jumbled myself a lot right now for u guys hehee...but hopefully someone will see through this mess and help me out ;)
Question
Kyrous_Kaoz
I know this will be a pretty easy one to solve but it eludes me for the time being and since im really up fulltime on workload right now i havent been able to sit down much and look it over carefully. For one assignment I was asked to create a program that given a string of N number of characters (meaning it could be any length the user desires) that it be placed centered on screen with some symbol character (such as ***) covering either side of it where empty spaces would be. Should the text be too big to fit in one line, then the program should sub divide it and print it in as many lines necessary. Now for this problem specifically imma be working with the assumption that the max number of chars that can the user can input per line are 80 (thats the min default for the linux console screen) ... This all would be real easy were I to use for's or while's but the purpose of this assignment is to create the program using the recursive technique..meaning creating a class with different methods inside that call each other, and one of them has to keep calling itself under an if condition to keep itself in aloop until that condition is met. Maybe I've jumbled myself a lot right now for u guys hehee...but hopefully someone will see through this mess and help me out ;)
Link to comment
Share on other sites
3 answers to this question
Recommended Posts