Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

From Zero To Data Hero With Chatgpt

Authors: Andrew Wu

1st Edition

B0CQRJPXD9, 979-8989523009

More Books

Students also viewed these Databases questions