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

  Implement a program to reverse the digits

Write a method, reverseDigit, that takes an integer as a parameter and returns the number with its digits reversed. For example, the value of reverseDigit(12345) is 54321.

  Create test class to constuct and call methods of your class

Create a test class to constuct and call the methods of your class. Describe your class and demonstrate your code functions properly.

  Expain what is runtime polymorphism

Expain What is runtime polymorphism in java programming?

  How these feature desirable in modern software engineerig

Java is a portable language and being an object-oriented programming language, it also encourages component reusability. How are these features desirable in modern software engineering

  Explain why such productions would be a problem

The first is that the grammar cannot have any left recursive productions. Give an example of a left recursive production and explain why such productions would be a problem.

  Write a complete java program called scorer

Write a complete Java program called Scorer that declares a 2-dimensional array of doubles called scores with three rows and three columns. Use a nested while loop to get the nine (3 x 3) doubles from the user at the command line. Finally, use a nest..

  Write a while loop that lets the user enter a number

1) Write a while loop that lets the user enter a number. The number should then be multiplied by 10, and stored in a variable called product. The loop should then iterate as long as product contains a value less than 100.

  Test a java application that will read file containing data

Design, Implement and test a Java application that will read a file containing data related to the passengers on the Titanic

  A java program that reads the records

A java program that reads the records from the golf.dat file and displays them. It also displays the name of the player with the best (lowest) golf score.

  Write a program that prompts a user to enter a us dollar

Write a program that prompts a user to enter a US dollar amount. Output a table similar to the one in the example below. The second prompt should ask the user to enter a 1 to convert to euros, a 2 to convert to pounds and a 3 to convert to ruble..

  Calculate and display the total retail value of all products

Your application must calculate and display the total retail value of all products sold after all five pairs of inputs are completed - Write a Java application that prompts the user for pairs of inputs of a product number

  Write java program to read in sequence of hourly temperature

Write down Java program which reads in sequence of hourly temperature readings over 24-hour period using arrays. Your program must find and show maximum and minimum temperatures.

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