Java Calculator

I have an assignment to add code to an RPN calculator.


Here is how the main calculator commands should work:


Entering a number should push that number on the stack.

Entering a math operation "+", "-", "*", or "/" should pop two values off the stack, do the operation on these numbers, push the result on the stack, and then print the result (top stack value) in parentheses.

The user can enter commands either individually on their own line, or several on one line. The program treats these the same and just accepts commands as a stream of "words".

Grading is as follows:


(10) Complete the instance variable declaration and constructor for the FloatListNode class. Consult our previous labs using linked lists to recall what need to be a node, but note that the stack needs to store float numbers, not int.

(40) Add methods to the FloatStack to implement all of the methods in the StackOfFloats interface.

(40) Complete the implementation of the commands in the Program class to replace the TODO comments.

(10) Test your calculator to make sure it behaves as desired, and run the [url removed, login to view] test script to make sure it produces only the one expected failure at the end.



In the project there are two classes, Program and FloatStack, and one interface StackOfFloats. The interface specification is already complete and describes an interface for a stack of floating point numbers. Do not change this interface, you must stay with this spec, but you will need to read the interface to use it properly. The two class files for Program and FloatStack are partially implemented, and parts you will need to fill in. Look through the code or search for comments with "TODO" in them, and replace them with code to complete the program.

Note that the incomplete starting program as given does not currently compile, because FloatStack's implementation of the interface is incomplete. To get it to compile as soon as possible, so that you can check your code as you add it, I would suggest adding an empty (stub) implementation for the required interface methods in FloatStack first, then you can start filling them out as adding other missing code in the program.

Note: Before trying to run and test your calculator, make sure you put something (a println) in doVerCmd in the Program class. Otherwise BlueJ will fail to open the Terminal Window in time for the user input to work.

Habilidades: Java

Veja mais: stack class java, print println java, pop commands, linked stack, linked int, java stack class, what is a stack, code labs, line calculator, push java, program using stack, stack java implementation, window todo, implement search java, top stack, calculator code project, java project classes, compile java project, java code implementation, java project calculator, terminal script, code change java, rpn calculator using stack, rpn calculator code, java comments

Acerca do Empregador:
( 29 comentários ) Los Angeles, United States

ID do Projeto: #5097299

Concedido a:


Hi, I have strong background in JAVA and experience in Algorithms. Let me help you. I am ready to start.

$60 USD em 3 dias
(32 Comentários)

7 freelancers estão ofertando em média $135 para esse trabalho


A proposal has not yet been provided

$94 USD in 4 dias
(19 Comentários)

Sounds simple enough. I have plenty of experience with simple and complex data structures in java, and finishing a calculator in Java should be no problem at all. Most likely I will finish before the 4 day mark, but th Mais

$157 USD in 4 dias
(1 Comentário)

I have clearly read and understood your project requirements. I am working as Team Lead with 6+ years experience. I have excellent expertise in Java and have recently completed several such assignments. I am a 5 star f Mais

$122 USD in 3 dias
(1 Comentário)

I CAN DO IT COMFORTABLY I've experienced & “SUPER DESIGNER in Portal Management and allround Web design/development for Webservices & ecommerce websites. My plete Skills : HTML/RTML/XML/SGML, ASP.NET with Ms Mais

$210 USD in 3 dias
(0 Comentários)

A proposal has not yet been provided

$147 USD in 3 dias
(0 Comentários)

I have done projects like that before in JAVA, C++ and VisualBasic. I'm very confident that I can complete your project.

$155 USD in 2 dias
(0 Comentários)