[Solved] Assignment 04

$25

File Name: Assignment_04.zip
File Size: 122.46 KB

SKU: [Solved] Assignment 04 Category: Tag:
5/5 - (1 vote)

Objective

The purpose of this assignment is to gain experience with the following new concepts: the RPN or postfix expressions, stack data structure.

Project Description

Write a program to implement the algorithm for evaluating postfix expressions that involve only single-digit integers and the integer operations +, -, *, and /. To trace the action of postfix evaluation, display each token as it is encountered, and display the action of each stack operation.

  1. Each digit or operator should be separated by a space, and end with :
  2. You should apply stack ADT in the program. You can use the Standard Template Library (STL) stack instead of Stack class defined in the text book.

Here is an example how to use the STL stack push/pop/top and empty functions which will be used in this project.

  1. 3. You may need to use function isdigit(int c) in standard header file #include to check if the token character is digit or not.

  2. To convert the single digit char c to the represented integer i, a simple method is to assign i by c -0 (for example):
  3. Paste your test output as the comments at the end of your source file proj5.cpp.

Upload your source code files (upload do NOT zip them! your source files: proj5.cpp) for the assignment below.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Assignment 04
$25