VS2010 C++ CST280 Week 9 and Week 8 - 48362

Solution Posted by
jordanblink

jordanblink

Rating : (19)A+
Solution Detail
Price: $15.00
Request Description

CST 280 In-Class Practice – Week 8

Capture the following program files from the course web page:

stackQueue.cpp using code yt49

stackType.h and queueType.h. from course demo files

Set up a project workspace including the three provided files. Note that the driver

simply instantiates one stack object and one queue object using the template forms of

the stack and queue class, respectively.

Next, examine the stack and queue operations on integers below. Trace the

algorithm and predict the output:

Push 3 onto the stack

Push 7 onto the stack

Enqueue 9 onto the queue

Push 8 onto the stack

Pop a value from the stack and discard

Pop a value from the stack and enqueue it onto the queue

Enqueue 1 onto the queue

Enqueue 2 onto the queue

Push 6 onto the stack

Enqueue 3 onto the queue

Dequeue a value from the queue and push in onto the stack

Until empty, dequeue each value from the queue and push it onto the stack

Until empty, pop each value from the stack and write it to the output console

Output: _________________________________________________

Finally, implement the code that will perform the operations in the driver

StackQueue.cpp to verify your analysis.

Deliverables: This cover page, source code for driver program and output.

 

CST 280 In-Class Practice – Week 9

Capture the following program files from the course web page:

Access classes dynStack.h and dynQueue.h (from Week 9 examples).

Also access file palindrome.cpp from Week 8.

Access the following data files (using code hj39):

palindrome0.txt

palindrome1.txt

palindrome2.txt

A previous example in class included an algorithm for determining is one word is

a palindrome. Use this example to modify the algorithm to handle an worldrecord

sized palindrome in the form of a palindromic sentence.

The file palindrome0.txt is a small example of a palindromic sentence.

After verifying this is a palindrome, test the (world-record) phrases in the other

two files. One is a palindrome and one is not.

Utilize the previous algorithm along with the code provided to update the

palindrome solution.

Hint: consider using isalpha() and tolower() functions within the

<cctype> library.

Deliverables:

Demonstrate output to your instructor.

 

CST 280 In-Class Practice – Week 9

Capture the following program files from the course web page:

Access class dynStack.h (from Week 9 examples)

and example balance.cpp (from Week 8 examples)

Access files bigBrackets1.txt and bigBrackets2.txt (using code

uk29). These contain very large sets of grouping symbols.

The previous example demonstrated in class included an algorithm for detecting

if a set of grouping symbols is properly balanced (i.e. all closures match all

openings in the correct sequence). Use the existing algorithm for testing to see if

an expression is balanced to solve a more expanded problem.

The provided files each include a very large set of symbols. The sequence of one

is balanced and the other is not. Alter the given program to match what is

required for these new, very large files and test both to find out. Utilize the

previous algorithm along with the code provided to validate these sets of extreme

brackets.

Note: unlike the previous example, the entire file is only one symbol set.

Deliverables:

Demonstrate output to your instructor.

Solution Description

VS2010 C++ CST2

Attachments
CPPCST280.zip
CPPCST280.zip
CST 280 Week8 StcakQueue.docx
CST 280 Week8 S...