Write program which accepts a space-delimited set of symbols

Assignment Help JAVA Programming
Reference no: EM131275213

PROGRAMMING ASSIGNMENT

FUNCTIONAL PROGRAMMING

INFIX EXPRESSION CALCULATOR

PRELIMINARY NOTES

You have your choice of programming languages for this assignment:

• Scheme (or Clojure)
• Ocaml (or F#)
• Java 8 (utilizing the "Functional Programming" features of the language
• Scala

RULES

(NOTE: Since a choice of languages is given, the "rules" have to remain flexible, hence the use of where applicable in several of the rules below.)

• Must use "High Order Functions" where applicable.
• The only permitted "looping constructs" are:

o Recursion
o Streams, Maps, Folds
o In some pure functional languages, these would be your only options

• Must use "strong" and proper datatypes where applicable

o For example each kind of operator would be its own type.

- (E.g. Addition and Subtraction would both be instances of an "Additive" type, but Multiplication and Division would be instances of a "Multiplicative type")

- In other words, each "precedence level" should be represented by its own type.

• Should use floating-point input and evaluation.

PROGRAM DESCRIPTION

1. Write a program which accepts a space-delimited set of symbols representing an infix arithmetic expression as described below.

a. The user should be prompted for the input (to be entered via keyboard)

2. Output:

a. The numeric evaluation of the expression
b. A string representing the arithmetic expression as an S-Expression

i. Hint: Easily generated from a simple pre-order tree traversal
ii. Note that any parentheses in the original input should not appear in the output (ie. Duplicating parentheses).

Reference no: EM131275213

Questions Cloud

What do you believe are good aspects about the method : What do you believe are good aspects about this method and what do you think are issues with this method? Be careful not to share any of your own personal passwords.
How are caucasian-americans influenced by race in society : How are Caucasian-Americans influenced by race in society today - What can we do to improve race relations in America and What are the factors contributing to the state of race relations in today's society?
Differentiate one step from two step area sampling : Differentiate one-step from two-step area sampling and indicate when each one is preferred. - What is meant by a skewed population? Describe a skewed population distribution variable and provide an example.
Describe the common treatments for the disorders : Describe each addiction including potential genetic and environmental factors leading to the addiction. Describe the common symptoms, especially those that impact the person both physically and psychologically. Describe the common treatments for t..
Write program which accepts a space-delimited set of symbols : Write a program which accepts a space-delimited set of symbols representing an infix arithmetic expression as described below. The user should be prompted for the input (to be entered via keyboard)
Define quantitative research and qualitative research : Define quantitative research. Define qualitative research. List the differences between these two research methods. What is pluralistic research?
Describe two formats of online focus groups : Indicate why covert observation would be appropriate for a study on how parents discipline their children when dining out. - Describe a traditional focus group.
Should the members of a focus group be similar or dissimilar : How are focus group participants recruited, and what is a common problem associated with this recruitment?- Should the members of a focus group be similar or dissimilar? Why?
Write an sql statement to delete the nantucket record : Write an SQL statement to delete the Nantucket record. Write the SQL necessary to recreate the ocean table in the same way it was create for question 1 but add the constraint that PercentOfSurface must be Between 0 and 100.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Delete a random element from an arraylist

Elements in an ArrayList and picking one at random to remove. Unfortunately, this slow, since deleting a random element from an ArrayList is slow because of all the shifting. For this question, you should modify the poll()method so that it runs in..

  Write a java application to display the following gui

Write a Java application to display the following GUI. At this point you are only implementing the display. We are not ready to make the calculator actually do any calculations

  Create a calorie counter application

Create a calorie counter application. The user should be able to set a daily calorie maximum using preferences. Individual meal entries can be entered for the day and all information will be saved to a local file (Not SQLite)

  Create a book class for the library application project

Create a Book class for the Library application project. In addition to properties of author and isbn, with setters/getters, the Book should override Object's base method "boolean equals(Object)" and have a "boolean validate()" method.

  Write a program that will prompt the user for a file name

Write a program that will prompt the user for a file name and open that file for reading. Print out all the information in the file, numbering each new line of text.

  Program to mimic a student information management system

Write a Java program to mimic a student information management system. The main entry page should have at least following options:

  Create java servlets

Create a new JSON "view" (e.g., a JSP page that only displays the JSON representation of the data)

  Write java application to demonstrate the behavior

The source code is patterned after a similar example that was taken from Joyce Farrell's textbook, Java Programming.

  Introduction to java

Show the Knowledge about the computer language "JAVA".

  Java application that reads a date in numeric form

Designand write a java application that reads a date in numeric form from a set of three fields and displays it in English within a label. Use appropriate buttons. For Example:

  Compute the area of the triangle

Compute the area of the triangle using Heron's Formula(below), in which s represents half of the perimeter of the triangle, and a,b, and c, represent the length of the three sides.

  Prepare a java program to play pig

Pig is a two player game where the players take turns repeatedly rolling a single 6 sided die. A player repeatedly rolls the die until one of two events happen:

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd