Question: Specification: Start with the given Java program prog340, which lets you select a file to read from your computer, reads the file, and interprets that
Specification:
Start with the given Java program prog340, which lets you select a file to read from your computer, reads the file, and interprets that file as the specification of a graph.[1] Read a file of the name F1[
The prog340 handout describes the format of the input file for this and all program deliverables.
As will always be the case in this class, the program must be written in Java and must run on the University Windows computer systems. To ensure this I strongly recommend that you:
- Use only Oracle Java 13 SE and earlier constructs, and
- Test it on the University systems before submission if you have any doubts about its ability to run on the University Windows.
Submit the Java source code to the open Deliverable A submission folder. You may submit either the source code or a full Eclipse package.
Output:
Here are sample outputs for two graphs (shading mine to show you the values added):
First graph:
~ val A B C D E
Alpha ~ ~ 3 2 9 5
Bravo S 4 ~ 5 3 8
Charlie ~ 9 7 ~ 42 11
Delta ~ 6 0 5 ~ 1
Echo ~ 9 6 4 2 ~
Yields output:
Path BCDEAB has distance 60.
Second graph:
~ val A B C D d L M m N S s W
Atlanta ~ ~ 957 581 725 1220 1942 608 898 752 2155 2201 538
Boston ~ 957 ~ 859 1571 1783 2594 1285 1127 207 2719 2505 420
Chicago ~ 581 859 ~ 803 928 1736 1185 354 718 1876 1758 601
Dallas ~ 725 1571 803 ~ 667 1248 1116 851 1384 1494 1698 1190
Denver ~ 1220 1783 928 667 ~ 812 1736 697 1645 957 1033 1507
LosAngeles ~ 1942 2594 1736 1248 812 ~ 2357 1500 2451 313 923 2301
Miami ~ 608 1285 1185 1116 1736 2357 ~ 1505 1097 2611 2755 917
Minneapolis S 898 1127 354 851 697 1500 1505 ~ 1024 1597 1415 940
NewYork ~ 752 207 718 1384 1645 2451 1097 1024 ~ 2594 2430 213
SanFrancisco ~ 2155 2719 1876 1494 957 313 2611 1597 2594 ~ 691 2464
Seattle ~ 2201 2505 1758 1698 1033 923 2755 1415 2430 691 ~ 2354
Washington ~ 538 420 601 1190 1507 2301 917 940 213 2464 2354 ~
Yields output:
Path mNSsWABCDdLMm has distance 15157.
Submit:
Submit your code as an Eclipse package, or submit all the .java source files in a zipped archive. Do not include test files.
Test Files:
Grading:
This deliverable is worth 25 points: Correctness will be assessed for 5 files at 4 points per file, including the three test files I gave you, and at least one file that I did not. I may use the same or different starting cities. There will be 5 additional points for design and documentation.
[1] See the prog340.doc file for details
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
