Question: Needing to compare my new files Recursive.java which contains the details of creating the 4 methods as specified above: int sum_sqr_rec(stack stk),(15 points) int plus_minus_rec(stack

Needing to compare my new files

  1. Recursive.java which contains the details of creating the 4 methods as specified above:
    • int sum_sqr_rec(stack stk),(15 points)
    • int plus_minus_rec(stack stk),(15 points)
    • void prt_chars_rev_rec(stack stk),(15 points)
    • void prt_chars_rec(queue stk),(15 points)
  2. RecursiveDemo.java which:
    • A- reads a string expression:
      • {(1+2)+[4*(2+3)]}
      • and store the expression in a stack and a queue.(15 points)
      • a- prints the corresponding expression "in reverse" using: prt_chars_rev_rec ( 5 points)
      • b- prints the corresponding expressing "as is" using: prt_chars_rec.( 5 points)
    • B- reads an array of integers: { 1, 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 }
      • and store them in a stack of ints.(5 points)
    • Then it:
    • C- prints the sum of the squares of the elements in the stack usingint sum_sqr_rec(stack stk) and outputting the value(5 points):
      • 385
    • D- prints the sum of the elements in the stack using:
      • intplus_minus_rec(stack stk)and outputting the value(5 points):
      • 1 - 2 + 3 - 4 + 5 - 6 + 7 - 8 + 9 - 10 = -5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To help you with the implementation of Recursivejava and RecursiveDemojava I will outline the details for creating the methods as per the problem statement This will include the method signatures how ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!