|
A free membership is required to access uploaded content. Login or Register.
Project 6 Pseudocode
|
Uploaded: 5 years ago
Category: Computer Engineering
Type: Other
Rating:
(1)
|
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()
}
|
|
|
Post your homework questions and get free online help from our incredible volunteers
867 People Browsing
189 Signed Up Today
|