Create a python program that will read two text.file, which will include the adjacency matrix of two alkane. In the end, the program will output their Wiener's index and will indicate which among the two has the higher boiling point.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section4.2: The If-else Statement
Problem 3E
icon
Related questions
Question

Create a python program that will read two text.file, which will include the adjacency matrix of two alkane. In the end, the program will output their Wiener's index and will indicate which among the two has the higher boiling point. 

Example

***isobutane.txt***

0,0,0,1
0,0,0,1
0,0,0,1
1,1,1,0

***n-butane.txt***

0,1,0,0
1,0,1,0
0,1,0,1
0,0,1,0

***wiener.py***

Enter alkane 1 filename: isobutane.txt
Enter alkane 2 filename: n-butane.txt

Results:
isobutane Wiener index: 9
n-butane Wiener index: 10
Most probably, the boiling point of n-butane is higher than isobutane

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr