Question: NEED IN PYTHON - - files to be Submitted: In this assignment, students should create two Python classes called Recursive.py , RecursiveDemo.py . After the
NEED IN PYTHON files to be Submitted:
In this assignment, students should create two Python classes called
Recursive.py
RecursiveDemo.py After the assignment has been completed, both files should be submitted for grading into the Dropbox for Assignment which can be found in the Dropbox menu on the course website.
The purpose of the assignment is to practice recursive writing methods. We will write four methods each worth points.
adef sumsqrrecstk:
which will receive a stack of numbers and output the sum of the squares of the elements in the stack.
bdef plusminusrecstk:
which will receive a stack of numbers example: and output the sum of the elements in the stack as follows:
cdef prtcharsrevrecstk
which will receive a stack of characters and print its elements in reverse.
ddef prtcharsrecqueue: which will receive a queue of characters and print its elements
Remember to use the stack and queue provided by the Python Library.
The Assignment will require you to create files:
Recursive.py which contains the details of creating the methods as specified above:
def sumsqrrecstk: points
def plusminusrecstk: points
def prtcharsrevrecstk: points
def prtcharsrecqueue: points
RecursiveDemo.py which:
Areads an expression:
and store the expression in a stack and a queue. points
a prints the corresponding expression in reverse" using: prtcharsrevrec points
bprints the corresponding expressing as is using: prtcharsrec. points
B reads an array as follows:
and store them in a stack. points
Then it:
C prints the sum of the squares of the elements in the stack using int sumsqrrecstk and outputting the value points:
Dprints the sum of the elements in the stack using:
def plusminusrecstk: and outputting the value points:
Do not forget to drop the files in the dropbox of Assignment
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
