Java Balanced Sysmbol Program using STack datastructure

Feb 3rd, 2012
Studypool Tutor
University of South Florida
Course: EEL
Price: $20 USD

Tutor description

In this assignment, you are asked to write a balance-symbol checker which checks for the following pairs of symbols in the source code files of Java programs: (), [], {}. This checker must implement the following algorithm: 1. Make an empty stack. 2. Read symbols until the end of the source code file. a. If the symbol is an opening symbol, push it onto the stack. b. If it is a closing symbol, do the following: i. If the stack is empty, report an error. ii. Otherwise, pop the stack. If the symbol popped is not the corresponding opening symbol, report an error.

Word Count: 127
Showing Page: 1/1
import java.util.Scanner;import java.util.Stack;/** * Created by e7006722 on 6/06/2014. */public class BalanceChecker { private static Stack stack = new Stack(); public static void main(String[] args) { Scanner scanner = new Scanner(BalanceCh

Review from student

Studypool Student
" Wow this is really good.... didn't expect it. Sweet!!!! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1821 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors