Project/ XXXXXXXXXXmkv CodeUsedInVideo.txt Code used in video: #include #include #include #include using namespace std; const int SPEED = 100; void SetColor(int foreground, int background) { WORD...

This is a stack simulation C++ project that shows characters being pushed into a graphical array and then show them being popped out. The video attached explains how it should be done. Create a visible stack (graphical interface) and showing how push/pop affects it Visual Studio 2019 preferred.


Project/2021-10-13 12-33-30.mkv CodeUsedInVideo.txt Code used in video: #include #include #include #include using namespace std; const int SPEED = 100; void SetColor(int foreground, int background) { WORD consoleColor; HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO csbi; if (GetConsoleScreenBufferInfo(hStdOut, &csbi)) { consoleColor = (foreground + (background * 16)); SetConsoleTextAttribute(hStdOut, consoleColor); } } void gotoxy(int x, int y) { COORD ord; ord.X = x; ord.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), ord); } // character c moves only from left to right void MoveHorizontal(int x1, int y1, int x2, int y2, char c) { int d = 0; while (x1 + d <= x2)="" {="" gotoxy(x1="" +="" d,="" y1);="" cout="">< c;="" sleep(speed);="" gotoxy(x1="" +="" d,="" y1);="" cout="">< "="" ";="" d++;="" }="" gotoxy(x2,="" y1);="" cout="">< c;="" }="" void="" movevertical(int="" x1,="" int="" y1,="" int="" x2,="" int="" y2,="" char="" c)="" {="" int="" d="0;" while="" (y1="" +="" d=""><= y2)="" {="" gotoxy(x2,="" y1="" +="" d);="" cout="">< c;="" sleep(speed);="" gotoxy(x2,="" y1="" +="" d);="" cout="">< "="" ";="" d++;="" }="" gotoxy(x2,="" y2);="" cout="">< c; } void moveobject(int x1, int y1, int x2, int y2, char c) { movehorizontal(x1,y1,x2,y2, 'x'); movevertical(x1,y1,x2,y2, 'x'); } void main() { system("cls"); moveobject(3,3,45,22, 'x'); } rubric.png c;="" }="" void="" moveobject(int="" x1,="" int="" y1,="" int="" x2,="" int="" y2,="" char="" c)="" {="" movehorizontal(x1,y1,x2,y2,="" 'x');="" movevertical(x1,y1,x2,y2,="" 'x');="" }="" void="" main()="" {="" system("cls");="" moveobject(3,3,45,22,="" 'x');="" }="">
Oct 13, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here