Computer Science Homework Solutions
Problem
#109062

C++

C++. See attached file for full problem description.

Attached file(s):
Attachments
Question 31.doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

Question 31.doc
  Question 34



  int func2(int m, int n) {

      if (n == 0)

            return 0;

      else

            return m + func2(m, n-1);

}





2



3



5



6





  Question 35



  int func1(int m, int n) {

      if (m==n || n==1)

            return 1;

      else

            return func1(m-1,n-1) + n*func1(m-1,n);

}





m > = 0 and n >= 0



m >= 0 and n >= 1



m >= 1 and n >= 0



m >= 1 and n >= 1





  Question 36



  int func3(int m, int n) {

      if (m < n)

            return 0;

      else

            return 1 + func3(m-n, n);

}





-5



0



1



5









A



B



C



D





  Question 38



  int func1(int m, int n) {

      if (m==n || n==1)

            return 1;

      else

            return func1(m-1,n-1) + n*func1(m-1,n);

}





3



5



7



9





  Question 39



  void decToBin(int num, int base)

{

      if(num > 0)

      {

            decToBin(num/base, base);

            cout<
      }

}





decToBin(4, 2)



decToBin(2, 4)



decToBin(9, 2)



decToBin(8, 1)





  Question 40



  int func2(int m, int n) {

      if (n == 0)

            return 0;

      else

            return m + func2(m, n-1);

}





n >= 0



m > n



m >= 0



n > m




Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$19.95)
Included in Download
  • Plain text response
  • Attached file(s):
    • 109062-C++ function answers.doc
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
Browse