Use java Problem Description The following table shows the distance (in km) between two towns. For example, distance between Bangi and Putrajaya is 8.3 km, and it is the shortest distance between two towns. Beranang Dengkil Putrajaya Sepang Nilai 12 25 13 35.1 30.3 30.0 0 33.5 33.6 Bangi Beranang Dengkil 12 Putrajaya 8.3 Sepang 25 0 Seremban 12 0 35.4 43.2 35.1 13.2 23 35.4 0 196 30.3 21.1 43.2 19.6 30.0 346 57.6 13.2 21.1 346 33.5 0 26.8 28 23 57.6 336 The above table information can be stored using array with size 7x7 since it involves 7 towns. Write a program to determine the nearest two towns of ANY given size of table Input The first line of input is a positive integer N (1 ≤N≤25) which indicates the size of table. The following N lines contains the data with N integer numbers.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
Use java
Problem Description
The following table shows the distance (in km) between two towns. For example, distance
between Bangi and Putrajaya is 8.3 km, and it is the shortest distance between two towns.
Sepang Nilai Seremban
25
13
Bangi Beranang Dengkil
0
12
12
Bangi
Beranang
12
Dengkil
12
Putrajaya 83
Sepang
25
Nilai
Seremban
13
28
0
35.4
43.2
35.1
13.2
23
Sample Input Output
35.4
0
19.6
30.3
21.1
43
Sample Input
Output
The output displays the shortest distance.
Putrajaya
8.3
19.6
0
30.0
34.6
57.6
7
e 12.0 12.0 8.3 25.0 13.0 28.0
12.0 e 35.4 43.2 35.1 13.2 23.0
12.0 35.4 e 19.6 30.3 21.1 43.0
8.3 43.2 19.6 0 30.0 34.6 57.6
25.0 35.1 30.3 30.00 33.5 33.6
13.0 13.2 21.1 34.6 33.5 @ 26.8
28.0 23.0 43.0 57.6 33.6 26.8 0
35.1
30.3
30.0
8.3
0
33.5
33.6
21.1
34.6
33.5
0
The above table information can be stored using array with size 7x7 since it involves 7 towns.
Write a program to determine the nearest two towns of ANY given size of table.
26.8
Input
The first line of input is a positive integer N (1 ≤N≤25) which indicates the size of table.
The following N lines contains the data with N integer numbers.
28
23
43
Sample Output
57.6
33.6
26.8
Transcribed Image Text:Use java Problem Description The following table shows the distance (in km) between two towns. For example, distance between Bangi and Putrajaya is 8.3 km, and it is the shortest distance between two towns. Sepang Nilai Seremban 25 13 Bangi Beranang Dengkil 0 12 12 Bangi Beranang 12 Dengkil 12 Putrajaya 83 Sepang 25 Nilai Seremban 13 28 0 35.4 43.2 35.1 13.2 23 Sample Input Output 35.4 0 19.6 30.3 21.1 43 Sample Input Output The output displays the shortest distance. Putrajaya 8.3 19.6 0 30.0 34.6 57.6 7 e 12.0 12.0 8.3 25.0 13.0 28.0 12.0 e 35.4 43.2 35.1 13.2 23.0 12.0 35.4 e 19.6 30.3 21.1 43.0 8.3 43.2 19.6 0 30.0 34.6 57.6 25.0 35.1 30.3 30.00 33.5 33.6 13.0 13.2 21.1 34.6 33.5 @ 26.8 28.0 23.0 43.0 57.6 33.6 26.8 0 35.1 30.3 30.0 8.3 0 33.5 33.6 21.1 34.6 33.5 0 The above table information can be stored using array with size 7x7 since it involves 7 towns. Write a program to determine the nearest two towns of ANY given size of table. 26.8 Input The first line of input is a positive integer N (1 ≤N≤25) which indicates the size of table. The following N lines contains the data with N integer numbers. 28 23 43 Sample Output 57.6 33.6 26.8
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY