Java Programming
For this project, you will develop a Java program that will act as an RPN reverse polish notation calculator
INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS
PRELIMINARIES:
You need to learn about top-down design and Stacks to do this assignment properly.
THE ASSIGNMENT:
For this project, you will develop a Java program that will act as an RPN (reverse polish notation) calculator. To do this, you will have to use the stack class (stack of integers), together with a driver program which can handle the operations:
- + add the top two items
- * multiply the top two items
- - subtract the top item from the next item
- / integer divide the second item by the top item
- % find the integer remainder when dividing the second item by the top item
- m unary minus -- negate the top item
- r exchange the top two items
- d duplicate top item on stack
- p print (to the screen) the top item
- n print and remove the top item
- f print all the contents of the stack (leaving it intact)
- c clear the stack
- q quit
- h (or ?) print a help message
There is a (similar) standard RPN calculator called 'dc' (desk calculator) on almost all UNIX systems.
INPUT:
Your program will have keyboard input from the user of the program.
Example: (note: @ stands for typing a return)
h @
p print top
n print top and remove
d duplicate top
r exchange top two items
f print contents of stack
c clear stack
+ add
- subtract
* multiply
/ integer divide
% integer remainder
m unary minus
q quit
h,? this help
33 44 p @
44
f @
33 44 #
r f @
44 33 #
r @
n @
44
d @
f @
33 33 #
+ p @
66
21 * p @
1386
11 + p @
1397
17 / p @
82
8 % p @
2
m p @
-2
f @
-2 #
c @
f @
#
q @
OUTPUT:
The program must write all its output to standard output (the default standard output is the screen).
WHAT TO TURN IN:
You will turn in two e-mail messages. Please follow these rules:
- Always send me e-mail as plain text in the main message body.
- Attach any Project files.
- Always use the exact subject line I specify for each message. (I often get hundreds of e-mail messages in a week. The subject line allows me to find, filter and sort messages.) You will lose a significant number of points on the assignment if you use the wrong subject line.
- Always send yourself a copy of each e-mail message you send to me, and check immediately to see if you receive the message intact. You are responsible for sending e-mail correctly.
Here is the list of things you have to turn in:
- At the start of class on the first due date email the following items:
- A Flow Chart diagram of a High Level Solution for the problem.
- A Skeletal Outline of the solution with adequate Comments.
Make sure all content is plainly readable and properly formatted.
Email your submission with the subject line: CS2500,prog3.1.
- Send the following item to me by e-mail before midnight on the second due date:
Your final version of the source code, with subject line: CS2500,prog3.f.
Related Questions
. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java
CS 340 Milestone One Guidelines and Rubric
Overview: For this assignment, you will implement the fundamental operations of create, read, update,
. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class
Retail Transaction Programming Project
Project Requirements:
Develop a program to emulate a purchase transaction at a retail store. This
. The following program contains five errors. Identify the errors and fix them
7COM1028
Secure Systems Programming
Referral Coursework: Secure
. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer
CS 340 Final Project Guidelines and Rubric
Overview The final project will encompass developing a web service using a software stack and impleme