Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the program to be written in C++ with 1 header and 1 or 2 classes. also the input.txt file is given to navigate

I need the program to be written in C++ with 1 header and 1 or 2 classes. also the input.txt file is given to navigate the car from start to finish avoiding obstacles.

In this assignment, you are expected to write a program to navigate a car from start point to finish point avoiding obstacles. You are given that there will always be a path. The car can move up, down, left or right but NOT diagonal. . The map should be built based on the input given in the input file where each dataset is delimited by -1. A data set will comprise of the map size, starting point, end point and obstacle locations. You are to decide on the strategy of the move based on the current car position and the end point location. Since you will be working with multiple data sets with varying size of maps, you would want to use multi-dimensional arrays and dynamic memory allocation.

To summarize the steps

1. Create the navigator object and open the input file.

2. Read data set from the input file

3. Plot(print) the map which consists routes and obstacles with car at the given start point **

4. Navigate to the end position this involves repetition of the following steps:

i. Deciding on the strategy of the move & making the move

ii. Printing the updated map **

5. When the car reaches the end point, print the number of steps taken to reach the goal **

6. Repeat step 2-5 till end of file

** Output should go to both the screen and an output file.

Programming concepts that are expected in the solution:

1. The program should consist of at least two modules:

i. Navigator module

ii. Test module

2. Following good object oriented programming practices

i Keep the data members private

ii. Accessor function should be declared to set and get the private data if needed.

3. Use operator > to read the data set is encouraged but is optional.

4. Use multi-dimensional arrays and dynamic memory allocation

image text in transcribedimage text in transcribed

Input.txt (6, 5) (3, 5) (1, 31, Size Start point End point Obstacles Delimiter (2,4

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

More Books

Students also viewed these Databases questions

Question

=+applying to all or most employers and employees?

Answered: 1 week ago

Question

To solve p + 3q = 5z + tan( y - 3x)

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago