Lab 3 CS1: Stack and Queues Applications (total 100pts) In this lab, you are provided with Stack, Queue, and PriorityQueue libraries that you will need to complete some application files.
Lab 3 CS1: Stack and Queues Applications (total 100pts)
In this lab, you are provided with Stack, Queue, and PriorityQueue libraries that you will need to
complete some application files. Your submission will include 4 applications programs (1 for each data
structure, and 1 with a combination of all).
Grading: I. Each program is 25 pts
o Header and comments (5 pts): write a header explaining what the program does and
who worked on it. Also include the class and semester information.
o Data input as specified (5 pts): each program has a different way of data entry, write as
asked in order to obtain full credit here.
o Data structure usage (5 pts): calling the correct functions of the correct data structure.
o Memory management (5 pts): Don’t forget to allocate correctly and free all pointers.
o Correctness and screenshot (5 pts): Submit a code that does what it is supposed to,
along with a screenshot of it running at your computer. Postfix Notation (Stacks … input expression using argv) The postfix notation is when an equation is written with operators first, then its operands. Read a
postfix expression into main using the argv parameter. Then, write a function that solves the expression
and prints the result onto the screen. You can assume that the expression will only contain integers and
the following operators: +, -, *, /, %, ^. The answer must be given as an integer. A detailed explanation
of the notation can be found in the following Wikipedia article:
http://en.wikipedia.org/wiki/Reverse_Polish_notation
Examples from command line:
./postfix 3 4 +
7
./postfix 2 4 + 3 / 6 +
8
./postfix 2 4 ^ 2 * 5 % 2 –
0 II. RPG Game (Queues … input #fighters, #healers, #enemies and their
stats inside a file using argv to pass the filename to main) In a turn based RPG (Role-Playing Game) game, battles are handled on a turn basis. The party member
(ally) that attacks first depends on how fast the character (member) is. Using Queues, simulate a battle
between fighters, healers, and enemies. The following struct can be used to represent a character:
typedef enum SpriteType{
FIGHTER,
HEALER,
ENEMY
} SType;
typedef struct _GameSprite{
SType type;
uint id;
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
