subject

I need help with this assignment. Please, someone, help me to fill these codes. I really do not know what I need to do. This is C++ (Data abstraction). I have to submit this assignment today. Please I'm really stressed out how to solve this problem. Thank you for understanding.
This is the assignment:

Project: One of the stack applications is to backtrack. As an example take a list of numbers. Negative numbers, 0, and 1 represent “commends”, the rest of the integers represent “data”. You may assume the input files contain valid data.
o Each time we read 0, display the number of elements in the stack. o Each time we read 1, display the element at the top of the stack. o Each time we read a positive number we push it onto the stack, and o Each time we read a negative number, we pop and print as many values from the stack as the absolute value of the negative number. If there are fewer numbers in the stack, print a message and nothing else. o When the end of the file is detected, print a message and the items left in the stack, if any.

See two examples on the next page and more details/requirements on the last page.

Input: Create the three input files using the following data or use the given files. numbers1.txt 10 20 30 1 40 0 50 -2 15 25 -3 60 70
numbers2.txt 1 0 20 30 40 -9 1 0 10 40 90 50 -6
numbers3.txt 15 25 35 45 0 1 0 55 65 1 75 0 1 0 -50 0 1 0 -5 10 40 50 60 70 80 90 0 1 0 -3 13 23 33 43 54 -5 0 1 0 17 27 7 47 57 67 77 87 97 19 29 39 49 59 69 79 89 99 0 1 -6 0 1 14 24 34 44 0 -150 54 64 0
Run the program once and save the output at the end of the source file as a comment. Compress the source and header files, input and output files (if any), and upload the compressed file: 22C_LastName_FirstName_H1.zip
Example 1: If the input file contains the following numbers: 10 20 30 1 40 0 50 -2 15 25 -3 60 70 Process input using a stack: Read 10, Push 10 Read 20, Push 20 Read 30, Push 30 Read 1, Display the element at the top of the stack: 30 Read 40, Push 40 Read 0, Display the number of elements in the stack: 4 Read 50, Push 50 Read -2, Pop and print 2 numbers: 50 and 40 Read 15, Push 15 Read 25, Push 25 Read -3, Pop and print 3 numbers: 25, 15 and 30 Read 60, Push 60 Read 70, Push 70 END OF FILE Display the stack from top to bottom: 70, 60, 20 and 10 Format output as shown below (do not show the processing details) Input File: numbers1.txt Top: 30 Count: 4 Top 2: 50 40 Top 3: 25 15 30 Stack: 70 60 20 10
Example 2: If the input file contains the following numbers: 0 1 10 20 30 -6 40 50 -5 Process input using a stack: Read 0, Display the number of elements in the stack: 0 Read 1, Display the element at the top of the stack: Empty Read 10, Push 10 Read 20, Push 20 Read 30, Push 30 Read -6, Display “Error” message since there are less than 6 items in the stack and do not change the stack. Read 40, Push 40 Read 50, Push 50 Read -5: Pop and print 5 numbers 50, 40, 30, 20 and 10 END OF FILE Display “Empty” Format output as shown below (do not show the processing details) Input File: myFile. txt Count: 0 Top: Empty Error Stack: 50 40 30 20 10 Stack: Empty

This is the first code:

#include
#include
#include
#include
#include

using namespace std;

#include "StackADT. h"

void printInfo();
void showTimeStamp();

int main()
{
string filenames[] = { "numbers1.txt", "numbers2.txt", "numbers3.txt", "" };

printInfo();
for (int i = 0; filenames[i] != ""; i++)
{
// call a function to process the input file using a stack
}

showTimeStamp();
return 0;
}

/*~*~*~*~*~*~
This function displays the project's title
*~*/
void printInfo()
{
cout << "Project: Stack ADT" << endl;
}

/*~*~*~*~*~*~
This function displays the current date and time
*~*/
void showTimeStamp()
{
time_t timeval = time(0);
char* chtime = ctime(&timeval);
cout << "\n" << chtime << endl;
}

/*~*~*~*~*~*~ Save the output below

*~*/

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 20:30
If an appliance consumes 500 w of power and is left on for 5 hours, how much energy is used over this time period? a. 2.5 kwh b. 25 kwh c. 250 kwh d. 2500 kwh
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Which explains extrinsic motivation? a)motivation in which there is a reward b)motivation that is personally satisfying c)motivation that is personally meaningful d)motivation in which the subject is interesting
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
In simple terms, how would you define a protocol?
Answers: 2
question
Computers and Technology, 24.06.2019 20:30
⭐️⭐️⭐️ what network is larger in size? man or wan? you ⭐️⭐️⭐️
Answers: 2
You know the right answer?
I need help with this assignment. Please, someone, help me to fill these codes. I really do not know...
Questions
question
Mathematics, 22.05.2021 22:20
question
Mathematics, 22.05.2021 22:20
question
Advanced Placement (AP), 22.05.2021 22:20