Reference no: EM131231946
PROBLEM SPECIFICATION:
Several major companies needing help in solving a network communications problem have approached us. Essentially, the desire is given partial information about network connectivity in the form of a network diagram, we have been asked to develop a method, which indicates all nodes reachable on the network from any node specified with the available information. Normally we will not really have the network diagram but rather a set of relations in the form (node[J] , node[K]) indicating communications currently exist from node J to node K. Some network nodes are not really destinations in the traditional sense, but special nodes (repeaters) used to facilitate communications between nodes separated by a large distance. These nodes receive network traffic, determine network routing, and retransmit the packet towards the desired destination.
To support high traffic volume, two separate half duplex communication lines too neighboring nodes normally connect each node in our network. One line is used to receive incoming traffic (packets) from the connected node; the other line is used to transmit outgoing packets. It is possible for one or both of these communications lines to be down at any given time. Hence it is possible for a network node to be able to receive but not transmit and vice versa. In the following sample network diagram, the arrows indicate the directions in which network traffic may currently travel between nodes.
Test your code using the following sample network diagram. Rows and columns must be labeled in ascending order using the node names in the presentation of results. Node names may be kept as characters or strings. You may declare them as a programmer defined data type (enumeration) if desired. Fixed and variable length strings may also be used to represent row and column labels if desired.
The results should appear in a matrix labeled as follows:
Data for the "C" Option:
The data for the lab must be entered dynamically at runtime and the results written to a file. You are encouraged to place the data in a file and use "I/O redirection" (see hints) for the "D" option. You may use "I/O redirection" to store the results in a file.I/O redirection is a technique that should be mastered by all professionals both programmers and users.
Process the information in the "D" Option sample network diagram. Prompt the user for the size of the array to hold the BMR (number of rows and columns) at runtime and dynamically allocatethe array in the system stack in Ada, C++, or Java. You specifically should not use "new, malloc," or any other operator, which allocates space in the heap in any language. Clearly mark this section of your code with a highlighter! Print each transaction as it is processed. I recommend the use of a data file. It will save you time and effort.With great reluctance, I will not take off for storing the data structure in the heap on the "D" option.
Submission: Submit a cover page with your name, COSC3319.xx where "xx" is the section number, time the class meets and date of submission. Clearly indicate you are submitting the "D" grading option. The cover page should be followed by the properly labeled "D" option results then the "D" option code.
"C" Option (best grade is 79):
You need not complete the "D" Option. Instead implement Warshall's algorithm as an Adapackage (class for C++/C#/Java). Build the BMR in your main program and pass it as a parameter to the package/class method implementing Warshall's algorithm. You specifically may not use "new, malloc," or any other operator, which allocates space in the heap in any language. Clearly mark the section of your code where you allocate the space with a highlighter!A 10 point penalty will be charged on your grade if you allocate storage in heap memory anywhere in your program. Print each transaction as it is processed. The BMR should be returned to the main program by reference (CBR). Print the results of Warshall's algorithm in the main program. All I/O must occur in the main program.Process both the "D" Option and "C" Option networks. You may assume the names of network nodes are a single character.
You may use "I/O redirection for files to complete the "C" Option.
Submission: Submit a cover page with your name, COSC3319.xx where "xx" is the section number, time the class meets and date of submission. Clearly indicate you are submitting the "C" grading option. The cover page should be followed by the "D" option results followed by the "C" Option results. The "C" Option code should appear next.
"B" Option (best grade is 89):
You must use Ada, C++, C# or Java to implement the "B" option. You are encouraged to use Ada, it requires by far the least programming effort. You need not do the "D" or "C" options. Rather implement Warshall's algorithmusing a generic package (template class in C++/Java) that allows the user to specify the data type for the row and column labels as well as the number of rows. Note the BMR will be a square matrix (same number of rows and columns).
Space for the BMR must be allocated in the system stackwithin the generic package, probably during generic instantiation! You specifically may not use "new," "malloc," or any other operator, which allocates space in the heap anywhere in your code. Specifically mark allocating space for the BMR with a highlighter!A 10 point penalty will be charged on your grade if you allocate storage in heap memory. Print each transaction as it is processed. All data must be read explicitly from a sequential text file and results printed to a text file in the main program.You may not use I/O redirection. Use a highlighter to mark where you open and close the text file.
Submission: Submit a cover page with your name, COSC3319.xx where "xx" is the section number, time the class meets and date of submission. Clearly indicate you are submitting the "B" grading option. The cover page should be followed by the "D" option results followed by the "C" Option results then the "B" Option results. The "B" Option code should appear next.
"A" Option (best grade is 100):
Space for the BMR must be allocated in the system stackwithin the generic package, probably during generic instantiation! You specifically may not use "new," "malloc," or any other operator, which allocates space in the heap at runtime in any language. Clearly mark this section of your code with a highlighter! You must read all transactions and print all results within the generic package/template. The I/O routines must be passed as generic parameters (Ada) or as pointers to functions (C++/C#/Java). Upon return to the main program, all storage required for the BMR must be reclaimed efficiently and automaticallyby the OS without programmer intervention or use of a garbage collector.
Ada encourages programmers to define and use their own data types. C++ and Java restrict programmers to intrinsic data types in generic (template) instantiations. Ada allows convenient instantiation with any programmer data type. You must use Ada, C++ or C# for the "A" option.
Submission: Submit a cover page with your name, COSC3319.xx where "xx" is the section number, time the class meets and date of submission. Clearly indicate you are submitting the "A" grading option. The cover page should be followed by the "D" option results followed by the "C" Option results, the "B" Option results and finally the "A" Option results. The "A" Option code should appear next.
Extensions for the use of this lab:
1) We must bring down a node for P.M. (preventive maintenance). How will the network be effected?
2) We wish to improve network reliability. How will inserting a node at a given point influence connectivity?
Attachment:- hall.rar