PostfixConversion

PostfixConversion - i import java.util.Stack; / / / / / / /...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.Stack; i // Assignment #: 11 // Name: Your McCabe // StudentID: 1200214441 // Lecture: 10AM // Description: Assignment 11 class displays a menu of choices to a user // and performs the chosen task. It will keep asking a user to // enter the next choice until the choice of 'Q' (Quit) is entered. / public class PostfixConversion { public static boolean precedence(char first, char second) { if(first== '+' || '-' < second == '*' || '/') return false; else return true; r /* The precedence method determines the precedence between two operators. * (here, they are either '+', '-', '*', or '/') If the first operator is * of higher or equal precedence than the second operator, it returns the value true; * otherwise, it returns the value false. (for instance, if the new operator is '+' or '-', * then all operators (+,-,*,/) have precedence greater than or equals to the operator. * If the ne `w operator is '*' or '/', then only the operators '*' and '/' have precedence * greater than or equals to the operator.) This method will be called from
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/20/2009 for the course CSE 205 taught by Professor Matasu during the Spring '08 term at ASU.

Page1 / 2

PostfixConversion - i import java.util.Stack; / / / / / / /...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online