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, 22.06.2019 05:00
Which two editions of windows 7 support 64 bit cpus? choose two out of professional, business, starter, or home premium.
Answers: 1
question
Computers and Technology, 22.06.2019 16:10
Drag each label to the correct location on the imagelist the do’s and don’ts of safeguarding your password.keep yourself loggedin when you leave your computer.don’t write your password down and leave it whereothers can find it.share your password with your friends.each time you visit a website,retain the cookies on your computer.use a long password with mixed characters.
Answers: 1
question
Computers and Technology, 23.06.2019 12:30
Animations and transitions are added from the
Answers: 1
question
Computers and Technology, 25.06.2019 01:30
The study of how to design software, solve problems such as computer security threats, or come up with better ways of handling data storage
Answers: 1
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
Geography, 21.01.2021 23:20
question
Biology, 21.01.2021 23:20
question
Computers and Technology, 21.01.2021 23:20
question
Social Studies, 21.01.2021 23:20
question
Mathematics, 21.01.2021 23:20
question
Arts, 21.01.2021 23:20
Questions on the website: 13722361