CMSC350 Program that accepts an arithmetic expression

Question # 00652610
Subject: Computer Science
Due on: 03/06/2024
Posted On: 03/06/2024 04:09 AM
Tutorials: 1
Rating:
4.9/5
Question Dot Image

CMSC350 Program that accepts an arithmetic expression

The second programming project involves writing a program that accepts an arithmetic expression of unsigned integers in postfix notation and builds the arithmetic expression tree that represents that expression. From that tree, the corresponding fully parenthesized infix expression should be displayed and a file should be generated that contains the three address format instructions. This topic is discussed in the week 4 reading in module 2, section II-B. The main class should create the GUI shown below:

The GUI must be generated by code that you write. You may not use a drag-and-drop GUI generator.

Pressing the Construct Tree button should cause the tree to be constructed and using that tree, the corresponding infix expression should be displayed and the three address instruction file should be generated.

The postfix expression input should not be required to have spaces between every token. Note in the above example that 9+- are not separated by spaces.

The above example should produce the following output file containing the three address instructions:

Add R0 5 9
Sub R1 3 R0
Mul R2 2 3
Div R3 R1 R2

It is not necessary to reuse registers within an expression as shown in module 2, section II-B, and you can assume there are as many available as needed. Each new expression should, however, begin using registers starting at R0.

Inheritance should be used to define the arithmetic expression tree. At a minimum, it should involve three classes: an abstract class for the tree nodes and two derived classes, one for operand nodes and another for operator nodes. Other classes should be included as needed to accomplish good object-oriented design. All instance data must be declared as private.

You may assume that the expression is syntactically correct with regard to the order of operators and operands, but you should check for invalid tokens, such as characters that are not valid operators or operands such as 2a, which are not valid integers. If an invalid token is detected a

1

RuntimeException should be thrown and caught by the main class and an appropriate error message should be displayed. Below is an example:

You are to submit two files.

  1. The first is a .zip file that contains all the source code for the project, which includes any code that was provided. The .zip file should contain only source code and nothing else, which means only the .java files. If you elect to use a package the .java files should be in a folder whose name is the package name.
  2. The second is a Word document (PDF or RTF is also acceptable) that contains the documentation for the project, which should include the following:
    1. A UML class diagram that includes all classes you wrote. Do not include predefined classes. You need only include the class name for each individual class, not the variables or methods
    2. A test plan that includes test cases that you have created indicating what aspects of the program each one is testing
    3. A short paragraph on lessons learned from the project
Dot Image
Getsolution Posted By :
Questions: 15154 Tutorials: 15153
Tutorials for this Question

CMSC350 Program that accepts an arithmetic expression

Tutorial # 00651509
Posted On: 03/06/2024 04:10 AM
Feedback Score: Not rated yet!
Purchased By: 2
Getsolution
Posted By:
Questions:
15154
Tutorials:
15153
Report this Tutorial as Inappropriate
Tutorial Preview
The solution of CMSC350 Program that accepts an arithmetic expression...
Attachments
CMSC350_Program_that_accepts_an_arithmetic_expression.ZIP (18.96 KB)

Great! We have found the solution of this question!

Related Questions
Examine the several different types of data insights that occur
Question Examine the several different types of data insights that occur in big data analytics:  ? Offer novel knowledge  ? Provide causation relationships  ? Add a competit …
Computer science - Is virtualisation cost effective
Computer science question Is virtualisation cost effective and does it support green IT? Contents Introduction Is Virtualisation cost effective? Running out of space? Needing Virtualisa …
Studying Computing involves developing both subject
Studying Computing involves developing both subject-specific and transferable skills. Describe the skills you have used prior to university, and discuss how you would expect those skills to develop wh …
Computer Science - Discuss the critical characteristics
Computer Science Question Assignment 1 - Question 1: Discuss the critical characteristics of communication channels in data communications. Explain how bandwidth and communication medium affe …
List and explain two browser add-ons(plug-ins)that improve the security
1- List and explain two browser add-ons(plug-ins)that improve the security of a user’s browser. Why are these features not built-into the browser? 2- What are two security risks associated wi …
How are browsers being used to mine crypto currency
Part A: How are browsers being used to mine crypto currency? (1 pt) Find an example of malvertising. Provide a screen shot of the malvertising. (2 pts) Provide the details on how and where you …
What are the seven categories of cybersecurity functions in the NICE
security awareness What are the seven categories of cybersecurity functions in the NICE Cybersecurity Workforce Framework (https://www.nist.gov/itl/applied-cybersecurity/nice/resources/nice-cybe …
The Computer Mouse - Once a nondescript box perched on a large
The Computer Mouse Once a nondescript box perched on a large ball bearing, today the computer mouse comes in a wide range of shapes with a variety of capabilities. There are cordless mice, ergonomi …
CMSC350 Program that accepts an arithmetic expression
CMSC350 Program that accepts an arithmetic expression The second programming project involves writing a program that accepts an arithmetic expression of unsigned integers in postfix notation and bu …
Week 6 Discussions - Local Security Good Practices
Week 6 Discussions Please respond to at least two main topics  1. Local Security Good Practices Discuss in detail several effective local security practices to harden your Linux distribu …
Recent Questions
Walden NURS4210/NURS4211 All Assignments Latest 2024
NURS-4210W-13/NURS-4211-13  Role of the Nurse Leader-Summer 2024 Week 3 Assignment WINDSHIELD SURVEY/COMMUNITY ASSESSMENT RESOURCES Be sure to review the Learning Resources before com …
Walden NURS4210/NURS4211 Week 6 Assignment Latest 2024
NURS-4210W-13/NURS-4211-13  Role of the Nurse Leader-Summer 2024 Week 6 Assignment ASSIGNMENT RESOURCES Be sure to review the Learning Resources before completing this activity. Cl …
Walden NURS4210/NURS4211 Week 5 Assignment Latest 2024
NURS-4210W-13/NURS-4211-13  Role of the Nurse Leader-Summer 2024 Week 5 Assignment DISASTER PLANNING FOR PUBLIC HEALTH-2 RESOURCES Be sure to review the Learning Resources before comp …
Walden NURS4210/NURS4211 Week 3 Assignment Latest 2024
NURS-4210W-13/NURS-4211-13  Role of the Nurse Leader-Summer 2024 Week 3 Assignment WINDSHIELD SURVEY/COMMUNITY ASSESSMENT RESOURCES Be sure to review the Learning Resources before com …
Walden NURS4210/NURS4211 All Weeks Practicum Latest 2024
NURS-4210W-13/NURS-4211-13  Role of the Nurse Leader-Summer 2024 Week 1 Practicum Role of the Nurse Leader in Population Health - Group A  PRACTICUM LEARNING OBJECTIVES Dev …
Walden NURS4210/NURS4211 Week 6 Practicum Latest 2024
NURS-4210W-13/NURS-4211-13  Role of the Nurse Leader-Summer 2024 Week 6 Practicum PRESENTATIONS Overview: This week, you will present your PowerPoint presentation to the class incorpora …
Walden NURS4210/NURS4211 Week 5 Practicum Latest 2024
NURS-4210W-13/NURS-4211-13  Role of the Nurse Leader-Summer 2024 Week 5 Practicum PRESENT YOUR POWERPOINT PRESENTATION TO YOUR COMMUNITY MEMBERS This week, you will be presenting your p …
Walden NURS4210/NURS4211 Week 4 Practicum Latest 2024
NURS-4210W-13/NURS-4211-13  Role of the Nurse Leader-Summer 2024 Week 4 Practicum EVIDENCE-BASED PRACTICE AND EVALUATION OF THE PROJECT THROUGH MEASURABLE GOALS Overview: Dr. Marci …
Walden NURS4210/NURS4211 Week 3 Practicum Latest 2024
NURS-4210W-13/NURS-4211-13  Role of the Nurse Leader-Summer 2024 Week 3 Practicum POPULATION CULTURAL CONSIDERATIONS AND GENETIC PREDISPOSITIONS Overview: This week, you will ident …
Walden NURS4210/NURS4211 Week 2 Practicum Latest 2024
NURS-4210W-13/NURS-4211-13  Role of the Nurse Leader-Summer 2024 Week 2 Practicum Role of the Nurse Leader in Population Health - Group A Back to Week at a Glance EPIDEMIOLOGY: …