Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help me write this in c++ and these are the inputs Assignment 4: File /o and Containers: Constructing Connectivity Map among Different Cities in

image text in transcribed
image text in transcribed
image text in transcribed
please help me write this in c++
image text in transcribed
image text in transcribed
and these are the inputs
Assignment 4: File /o and Containers: Constructing Connectivity Map among Different Cities in an Island Description: In this assignment, you have to construct a graph showing the connectivity information among different cities in an island. There are 46 cities in the island. Please find attached a file named "Terrain.obj that contains the topological information of the island. The terrain model of the island (below) shows that its topology is undulated. In Terrain.obj file, lines starting with p' contains the 3-dimensional coordinates of the center of different cities. "p' stands for position The first line starting with 'p' refers to the city with index V' and its corresponding center coordinates (x, y and z). Similarly, the second line starting with p' corresponds to the information for city 1 and so on. You will find there are information for 46 cities. Next, you'l1 also find some lines starting with c' and followed by some integer. "c' stands for connectivity information. Let us take the very first line of the file starting with character c' c 13 28 41 This means cities 13, 28 and 41 are connected to each other. Now, the next line shows more connection information: 13 41 42 That means city 13 has also connection with city 42 and vice versa, (41 repeated here) Down the road you'll see that city 13 has also connection with cities 12 and 28. c 12 28 13 You'll also see some repeated information. 12 13 42 In the end, we can see that city 13 is connected to the following four cities: 12, 28, 41 and 42. Each line starting with character c' contains the connectivity information for 3 cities. City 13 has four connections and has formed 4 triangles with its 4 connectivity information

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started