Anúncio
Writing Recursive FunctionsNo loops are permitted in any of the c.pdf
Próximos SlideShares
You are a compensation analyst for L & M Engineering Inc. and you ha.pdfYou are a compensation analyst for L & M Engineering Inc. and you ha.pdf
Carregando em ... 3
1 de 1
Anúncio

Mais conteúdo relacionado

Mais de AMIOPTICPLUS(20)

Anúncio

Writing Recursive FunctionsNo loops are permitted in any of the c.pdf

  1. Writing Recursive Functions: No loops are permitted in any of the code you write (not even in the test functions or helper functions).The goal is to practise recursion. Write function and a test function using assert statements. You can use helper functions if you like. // Pre-condition: // none // Post-condition: // Returns a copy of s, but with all leading and trailing spaces removed. // No other characters are changed. For example, strip(" ab c d ") // returns "ab c d". If s is the empty string, or a string of all spaces, // then "I" is returned. // Constraints: // Must be implemented using recursion (and no loops). You can write helper // functions if necessary. string strip(const string& s); void strip_test();
Anúncio