php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS301 Data Structures Assignment No 01 idea solution spring 2011
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#19
Instructions
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit (zero marks) if:
o The assignment is submitted after due date.
o The submitted code does NOT compile.
o The submitted assignment does NOT open or file corrupt.
o The assignment is copied (from other student or ditto copy from handouts or internet).
Uploading instructions
Your Submission must include:
  1. A working Make File (Dev-C++ project File).
  2. All the Source Code (.h and .cpp files) necessary to compile and run your program.
  3. Place all the files in a folder then Zip this folder and Upload it on VU-LMS

Note: Use Dev-C++ IDE.
Objective
The objective of this assignment is

o To give you some practice exercise of Stack Data Structure.

For any query about the assignment, contact at cs301@vu.edu.pk
GOOD LUCK

Marks: 20
Write a C++ program to evaluate postfix expressions. Your program should take postfix expression as an input, process it with the help of stack and display the result after performing required calculations.

Only following Binary operators are allowed for this program:
+, -, *, /, ^ [addition, subtraction, multiplication, division, exponentiation]

If some error occurs while processing postfix expression, your program should display a meaningful message, like:
Error: Division by zero not allowed
Error: Two operands required for __ operator
Error: Invalid postfix expression

Sample Run:
Enter postfix expression to evaluate:
10 20 + Entered by user

The result is: 30

Do you want to enter another postfix expression to evaluate? [Y/N]
Y Entered by user

Enter postfix expression to evaluate:
30 40 + * Entered by user

Error: Two operands required for * operator

Do you want to enter another postfix expression to evaluate? [Y/N]
Y Entered by user

Enter postfix expression to evaluate:
30 40 + 50 60 * Entered by user

Error: Invalid postfix expression

Do you want to enter another postfix expression to evaluate? [Y/N]
Y Entered by user

Enter postfix expression to evaluate:
6 2 3 + - 3 8 2 / + * 2 ^ 3 + Entered by user

The result is: 52

Do you want to enter another postfix expression to evaluate? [Y/N]
N Entered by user

Thank you for using this program.
Lectures Covered: This assignment covers Lecture # 5-9
Deadline: Your assignment must be uploaded/submitted at or before 17-Nov-2011.
Reply


Messages In This Thread
CS301 Data Structures Assignment No 01 idea solution spring 2011 - by makyle - 11-17-2011, 06:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,369 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,957 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,989 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,228 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,294 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 2,023 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,715 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,854 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,753 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,854 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support