Top Posters
Since Sunday
g
3
3
2
J
2
p
2
m
2
h
2
s
2
r
2
d
2
l
2
a
2
A free membership is required to access uploaded content. Login or Register.

Project 6 Pseudocode

Uploaded: 5 years ago
Contributor: gvan9
Category: Computer Engineering
Type: Other
Rating: (1)
Helpful 1 
Unhelpful
Filename:   Project 6 Pseudocode.txt (1.83 kB)
Credit Cost: 1
Views: 164
Last Download: N/A
Transcript
?Gavin Poulton, None. Lab 013, 12/4/2018 Make a vector of dots, then change individual coordinates to the letters Struct point(){ Double X Double Y } Struct Planet(){ Int Id (point, the struct) location String Name Char Symbol } ofstream output(journey.txt); InputData(){ String namesFile String locationsFile Cout “Enter Locations Filename: “ Cin locationsFile Cout “enter names filename: “ Cin names Ifstream namesInput(namesFile); Ifstream locationsInput(locationsFile); If(!namesInput.is_open() or !locationsInput.is_open()){ Cout “Input file could not be opened” Return 1 } While(readinplanets){ } Vector string Names Vector double Locations } CorrectErrors(){ Names.remove “XX” names.find “underscores” Names.replace “spaces” } If(ids match in the struct){ Overwrite name } Struct(mapInfo){ (pass in this info wherever you need to pass in the functions) Startrow Startcolumn Endrow Endcolumn Numrows numcolumns } Fin >>numrows Fin >>numcolumns CreateMap(){ } CalculateDistance(){ If(){ } Else{ Algorithm 2 } } Int visitedplanets = 0; (increase this value every time you visit a planet) CalculateRoute(){ For(planets that haven’t been visited yet){ While(iterating through the planets filtered by the forloop){ Find closest planet that has not been visited(findclosest()) Visit it Mark as visited Print out planet name and where you are } } } PrintOutput(){ } Int main(){ InputData() }

Related Downloads
Explore
Post your homework questions and get free online help from our incredible volunteers
  867 People Browsing
 189 Signed Up Today
Your Opinion
Which industry do you think artificial intelligence (AI) will impact the most?
Votes: 352