Question: in c + + In this assignment, you will be implementing a program that: 1 . Reads values from user input until zero is entered.

in c++
In this assignment, you will be implementing a program that:
1. Reads values from user input until zero is entered. (Use a queue)
Example: 8012345-120304050678910-21112-33322-5
2. Scans the inputs to do the following: (Use a stack)
a. If a negative number is entered, the program must backtrace and print the five
numbers that come before that negative number. Then, remove the five numbers
and the negative number.
b. If there are fewer numbers than five, print an error message and stop the program.
c. repeat until scanning all inputs or an error occurs.
Output: 54321109876121150403022332080
Error: less than 5 numbers left
3. Test your program with several inputs, such as:
a.8012345-120304050678910-21112-33322
b.8012345-120304050678910-21112-333227-5
c.801245-120304050678910-21112-333227-5

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 Databases Questions!