CSC/BIF 245 Objects and Data Abstraction Assignment 5

$30.00

Download Details:

  • Name: Assignment_5-enib6e.zip
  • Type: zip
  • Size: 42.48 KB

Description

Rate this product

Question 1 (10 points). Implement a stack using linked list. Use a stack to solve the problem of evaluating a fully parenthesized expression that we have seen in class.

A fully parenthesized expression is an arithmetic expression where each operator is surrounded by two operands and two parentheses. For example, the following are fully parenthesized expressions:   ( ( 9 + 7 ) * 6 ), ( ( 5 – 3 ) + ( 9 – 8 ) ), ( ( ( 9 + 8 ) – ( 9 * 70 ) ) – ( 17 + 2 ) ). You may assume that all numbers are positive integers,  that the expression contains the following operators only: +, -, *, /, % and that all numbers, operators and parentheses are surrounded with space. Your code should work with all possible integers.

Question 2 (10 points) HTML is a simple language that is used for simple web pages. It relies on tags to format the pages. Assume that the only tags possible are: <b>, </b>, <i>, </i>, <h1>, </h2>, <html>, </html>. Tags format the text that is between them and should properly match. For example, text that appears between <b> and </b> will be displayed in bold. Text between <i> and </i> will be displayed in italics. Every document must start with <html> and end with </html>. Write a program that reads a text file containing HTML code and checks if the code is properly tagged.

Question 3 (10 points) Implement a queue using arrays.

What to submit

Use Blackboard to submit all your .java and .class files as well as any input files that might be required by your code. Make sure to write your name, student id and date of last modification on top of each .java file.