Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction Maze Solver - Source Code in C++Format Only! You Must Include the Source Code for your application this will help your application run the

Introduction  Maze Solver - Source Code in C++Format Only!

You Must Include the Source Code for your application this will help your application run the process.

Describe abstract and concrete requirements for data structures and algorithms. Describe a range of standard data structures and algorithms, in terms of both functionality and performance characteristics.

 By reasoning about behavior and performance, be able to critically select appropriate data structures and algorithms for a given application, Comment your program throughout you must do this do show you are following the good commenting program practices.

The application: Maze Solver Application in C++ Don't Include the Coding Down Below, as It does not Work at all, Has errors, Include Source Code relating to a Maze Solver program in C++ Format Only. Also remember to comment your programming code throughout.

Don't Include this code done below as it does not work has Errors for #include , COORD MazeExitCoords, COORD StartingPoint,SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),color);& Sleep(50);

image

Wrong Code:

#include

#include

const int MazeWidth = 30;

const int MazeHeight = 20;

const char MazeExit = '$';

const char Wall = '#';

const char Free = ' ';

const unsigned char SomeDude = 254;

COORD MazeExitCoords;

COORD StartingPoint;

using namespace std;

char Maze [MazeHeight][MazeWidth];

void FillDaMaze(){

MazeExitCoords.X = MazeWidth - 20;

MazeExitCoords.Y = 2;

StartingPoint.X = 3;

StartingPoint.Y = MazeHeight - 3;

for(int i = 0; i < MazeHeight; i++){

for(int ii = 0; ii < MazeWidth; ii++){

if(i == 0 || i == MazeHeight - 1 || ii == 0 || ii == MazeWidth -1){

Maze[i][ii] = Wall;

}

else{

Maze[i][ii] = Free;

}

if(i == MazeExitCoords.Y && ii == MazeExitCoords.X){

Maze[i][ii] = MazeExit;

}

else if(i == StartingPoint.Y && ii ==StartingPoint.X){

Maze[i][ii] = SomeDude;

}

}

}

}

void PrintDaMaze(int color){

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),color);

for(int i = 0; i < MazeHeight; i++){

for(int ii = 0; ii < MazeWidth;ii++){

cout << Maze[i][ii];

}

cout << endl;

}

}

void FindYourWayThroughTheMaze(){

if(Maze[StartingPoint.Y + 1][StartingPoint.X] != Wall &&Maze[StartingPoint.Y + 1][StartingPoint.X ] != SomeDude){

StartingPoint.Y++;

}

else if(Maze[StartingPoint.Y][StartingPoint.X + 1] != Wall&& Maze[StartingPoint.Y][StartingPoint.X + 1] !=SomeDude){

StartingPoint.X++;

}

else if(Maze[StartingPoint.Y - 1][StartingPoint.X] != Wall&& Maze[StartingPoint.Y - 1][StartingPoint.X ] !=SomeDude){

StartingPoint.Y--;

}

else if(Maze[StartingPoint.Y][StartingPoint.X - 1] != Wall&& Maze[StartingPoint.Y][StartingPoint.X - 1] !=SomeDude){

StartingPoint.X--;

}

Maze[StartingPoint.Y][StartingPoint.X] = SomeDude;

}

int main(){

FillDaMaze();

PrintDaMaze(10);

while(StartingPoint.X != MazeExitCoords.X || StartingPoint.Y !=MazeExitCoords.Y){

FindYourWayThroughTheMaze();

system("CLS");

PrintDaMaze(10);

Sleep(50);

}

}

Your application must:

 implement two different standard algorithms that solve thesame real-world problem;

make use of appropriate data structures for the application's needs;

allow you to compare the performance of the two algorithms as you vary the size of the input data.

Application: - Choose a problem you'd like to investigate e.g., Maze Solver.

- Decide on two standard algorithms that you think fit as solutions to this problem.

- Implement them both and measure and compare their performance with varying input sizes.

Make sure you have a good range of data input sizes and compare both algorithms with all input size options.

- Follow good programming practices throughout. Acknowledge and reference any external resources used in your code.

Problems: Current File 9 Project Errors > < main.cpp ~/CLion Projects/untitled1 9 problems 'windows.h' file not found :2 Unknown type name 'COORD' :9 Unknown type name 'COORD' :10 Use of undeclared identifier 'STD_OUTPUT_HANDLE' :46 Use of undeclared identifier 'Sleep' :100 A Clang-Tidy: Narrowing conversion from constant value 254 (0xFE) of type 'unsigned char' to signed type 'char' is implementation-defined :40 A All calls of function 'PrintDaMaze' are unreachable :45 A Clang-Tidy: Use range-based for loop instead :48 A Clang-Tidy: Repeated branch in conditional chain :61

Step by Step Solution

3.57 Rating (157 Votes )

There are 3 Steps involved in it

Step: 1

savedata break default SystemoutprintlnInvalid choice break while choice schedule the appointment static void scheduleappointment int id char typ Stri... 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

Step: 3

blur-text-image

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

Global Business

Authors: Mike W. Peng

3rd Edition

9781285528489, 1133485936, 285528484, 978-1133485933

More Books

Students also viewed these Programming questions