Commit 8ef03f0d authored by Walterio Montanez's avatar Walterio Montanez

autosave

parent a796605f
......@@ -110,16 +110,55 @@ int minutePrompt (int minute) {
} while (true);
}
string directionPrompt (string direction) { // prompts user for input and asked for direction (East, West, North, South, Northeast, Northwest, Southeast, Southwest)
pair<double,double> altAndAziPair (double altitude, string Direction) {
double Azi;
pair<double,double> aziPair;
}
double anglePrompt (double angle) { //prompts user for the angle they are looking at (0.0 - 90.0 degrees)
do {
cout << "Enter the altitude at which you are looking (0-90): ";
if (!(cin >> altitude)) { // validates that numbers were entered and checks input
cerr << "Error! Please enter a valid integer." << endl;
cin.clear();
cin.ignore(1000, '\n');
continue;
} else if (altitude < 0 || altitude >= 90) {
cout << "Please put in a valid value." << endl;
}
} while (false)
do {
cout << "Enter a cardinal direction (North, South, East, West, Northeast, Southeast, Southwest, or Northwest): ";
cin >> Direction;
if (Direction != "North" || Direction != "South" || Direction != "East" || Direction != "West" || Direction != "Northeast" || Direction != "Southeast" || Direction != "Southwest" || Direction != "Northwest") {
cout << "Error! Please input a valid direction";
}
} while (Direction != "North" || Direction != "South" || Direction != "East" || Direction != "West" || Direction != "Northeast" || Direction != "Southeast" || Direction != "Southwest" || Direction != "Northwest")
if (Direction == "North") {
Azi = 0;
} else if (Direction == "South") {
Azi = 180;
} else if (Direction == "East") {
Azi = 90;
} else if (Direction == "West") {
Azi = 270;
} else if (Direction == "Northeast") {
Azi = 45;
} else if (Direction == "Southeast") {
Azi = 135;
} else if (Direction == "Southwest") {
Azi = 225;
} else if (Direction == "Northwest") {
Azi = 315;
}
aziPair = make_pair(altitude,Azi);
return aziPair;
}
double dateToHour (string month, int day, int hour, int minute) { // Converts the date into hours
//variables
double totHours = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment