Question: Question II ( 4 0 points ) : Using the provided Stack class implementation in the lab, you will create a parser to Question II

Question II (40 points): Using the provided Stack class implementation in the lab, you will create a parser to Question II (40 points): Using the provided Stack class implementation in the lab, you will create a parser to identify a secret message hidden within another string. These secret messages are enclosed in curly braces within otherwise readable text (e.g., "This sentence contains a {terces} message"). The secret messages are just words in reverse, which we can use a stack to flip back into a readable format. Write a method decode() that prints all secret messages between '{' and '}' characters. Below are some sample outputs.
\table[[Input,Expected output],[This is {202SCI} Data Structure,This is ICS202 Data Structure],[I am studying computer science at KFUPM,I am studying computer science at KFUPM],[\table[[{ avaJ } and { nohtyP } are both powerful],[languages for developing apps and software]],\table[[Java and Python are both powerful languages for],[developing apps and software]]]]
identify a secret message hidden within another string. These secret messages are enclosed in curly braces
within otherwise readable text (e.g., "This sentence contains a {terces} message").The secret messages are just
words in reverse, which we can use a stack to flip back into a readable format. Write a method decode() that
prints all secret messages between '{' and '}' characters. Below are some sample outputs.
Input Expected output
This is {202SCI} Data Structure This is ICS202 Data Structure
I am studying computer science at KFUPM I am studying computer science at KFUPM
{avaJ} and {nohtyP} are both powerful
languages for developing apps and software
Java and Python are both powerful languages for
developing apps and software
Question II ( 4 0 points ) : Using the provided

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!