CS211: Programming Practicum - Archipelago Expedition Planning - Computer Science Assignment Help

Download Solution Order New Solution
Assignment Task:

Archipelago Expedition Planning. What is the Fastest Way?

For this program, you will write a C++ Program to represent an archipelago expedition. This expedition will use an array of linked lists as its primary storage structure. This type of storage structure is typically called an “adjacency list”. We will implement a Breadth-First Search to find the short path between locations in the archipelago.

Welcome to paradise! You have travelled to a beautiful archipelago in the Pacific Ocean and you are planning your great expedition. These group of remote islands are accessible with ferry rides. Each island has a unique number. If there’s a ferry ride from Island X to Island Y, the network depicting the archipelago will have an “edge” from X to Y. Below are a number of drawings representing this idea. Think about this drawing as maps available in the tavern of each island that will inform all tourists how to move between islands and plan their expedition. The islands are represented by a circle and the edges are represented by arrows. Consider the first drawing, this archipelago consists of 6 islands. It has a ferry ride between island 1 to island 2. Island 3 has three ferry rides going to island 3, island 4, an island 5. There are no ferry rides out of island 3 or island 5 so you have to be careful, you can get stuck there. Legend has it, the islands are so beautiful no one wants to leave after arriving (or maybe there’s a monster eating newly arrived tourists, I leave this to your imagination). There are two ferry rides leaving island 4 for island 5 and island 6. Finally, there’s one ferry ride leaving island 6 for island 3.

ferry ride

There are 5 islands, so we have an array of 5 linked lists. Since Island 3 has ferry rides to two Islands, namely Island 1 and Island 4, the linked list for Island 3 has two nodes: one node containing the value 1; another node containing the value 4.

Program Input and Commands

The input for the operations will come from standard input and from files. The input will initially come from standard input. If the user-specified the f command, your program will then read input from a file. See the description below for more details. The commands are to follow the descriptions given below. 

Note: that the form <int> could be any integer number and it will NOT be enclosed in angle brackets. <int> is just a notation to specify an integer value. The integer value is to be input on the same line as the command character. If the first character on the line is not one of the following characters, print an error message and ignore the rest of the information on that line.

Program Input and Commands

Initially, your program should have the array to hold 10 islands (numbered 1 to 10). If a command specifies an island outside of the current valid range, print an error message and ignore the command. The code given in proj6Base.cpp should provide the basics on reading input. You will need to do some cutting and pasting of code to read in input for all commands. The input is properly read in for the t and f commands. It is assumed that you can determine the code for the rest of the commands by looking at the code those these two commands.

Expedition Algorithm and the Island Object
To determine the path from island X to island Y in one or more ferry rides, a breadth-first-search algorithm must be used. For this algorithm to work, we will need to be able to store which was the previous island when each island was visited. Setting up an Island-class is required. This object will contain all of the data that one island knows:

• the head of the linked list for the island’s adjacency list,
• a value to determine if an island has been visited or not (see the end of the paragraph below), and
• the methods to use that data.

The Archipelago Expedition MUST be a dynamic array of these Island objects. The adjacency list will also need a Node class/object to store the linked list information. Note that for the Breadth-First Search the “visited” information must include a Boolean value showing it was visited. Besides, it needs to know from which Island the first “outgoing ferry ride” originated. For example, assume Isla \nd 4 is first visited with a ferry ride from Island 2. The visited information would need to store the value of 2 as the “visited value” for Island 4. Initially when the Islands are being marked as “unvisited”, store a unique value that cannot be used an Island value, such as -1 (or -999 or 0 or something less than 1).

The pseudo-code for Breadth-First Search algorithm is as shown below. Note it is valid to ask, can I go from Island Z to Island Z in one or more ferry rides. It really asks, “If I leave Island Z, how do I return to it?”

Programming Practicum

Multiple Source Code Files
Your program is to be written using at least two source code files. One of the sources file files is to contain the main function of the program named in a file using your NetId and Program name, like:
netidProj6.cpp

The other source code file must contain your Island-class in a file named:
Island.cpp

You may use additional source code files if you wish (i.e. MyList.cpp), but these two are required. The above implies that you will need to write any appropriate .h file(s) and a makefile.

Coding Style
Don’t forget to use good coding style when writing your program. Good coding style makes your program easier to be read by other people as the compiler ignores these parts/differences in your code. Elements of good code style include (but may not be limited to):
• Meaningful variable names
• Use of functions/methods
• Proper indentation
• Use of blank lines between code sections
• In-line comments
• Function/method header comments
• File header comments

The Code Review Checklist also hints at other elements of good coding style.


This CS211: Computer Science Assignment has been solved by our Computer Science Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.