Parsing Tree Programing Assignment

Similar to the parsing tree example in class, there is not much usefulness in parsing and evaluating statements without an operator. Therefore, it is safe to assume that any input to your parsing tree will contain an operator.
Examples of valid inputs are:

( T AND F )
( ( T OR M_0.3 ) AND P_0.8 )
( P_0.9 OR M_0.4 )

Example of inputs that are not expected (and that you don’t need to account for):

( T )
( P_0.85 )
( F )

Also, if you haven’t started, and want a clean slate to start with, use this skeleton code in MS Teams: (Links to an external site.)
What is the assignment?

To implement functions to build, evaluate, and print expressions using our (made-up) maybe-probably logic

What to hand in?

One (and only one) *.py file should be handed in. All your checks, unit tests should be inside of this file (similar to last assignment).
Note that your program should be able to be run at console/terminal (e.g. $ python If it does not, then the execution portion of the assignment will be 0.
Also note that you do not need to hand in nor; and you do *not* need to copy them into your file. Just import them. (For Peer Reviewers, ensure you put the code you will review in the same directory as

What needs to be done? 
The primary tasks in this fourth assignment are to implement the following three functions.
1. buildMPLogicParseTree(s) – this function should take a string as input (e.g. s = ‘( T OR P_0.9 )’) and should return the binary tree representing the parse tree as described in class
2. evaluateMPLogicParseTree(t) – this function should take a binary tree as input and should return a T or an F that is based on the on the input statement
3. printMPLogicExpression(t) – this function should take a binary tree as input and should return the string that looks like the original string (perhaps with extra parentheses)
4. create some examples of how your functions work (inside of def main()), and test that each of the functions works correctly (using unittest)
Note: Those exact function names above should be used. If those name are not used 10pts will be automatically deducted.

you should use the file for inspiration (located in MS Teams -> General -> Files -> Code); note: that file is for building entirely different types of parse trees so only parts of it will be relevant to this assignment
you will also want to download the files and, and import them from your *.py file (all three files will need to exist in the same directory/folder)
as with the last assignment, your *.py file will be run through a test script

When you submit your assignment, it will be graded in large part based on whether it successfully runs when using different input strings. The tests will roughy look like the following:
pt = buildMPLogicParseTree(‘( ( T AND F ) OR M_0.3 )’)
ans = evaluateMPLogicParseTree(pt)
exp = printMPLogicExpression(pt)

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
The price is based on these factors:
Academic level
Number of pages
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
Open chat
You can contact our live agent via WhatsApp! Via + 1 3234125597

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 30% with the discount code GIFT