Commit 238c48fd authored by Brandon Reid's avatar Brandon Reid
Browse files

autosave

parent 4e9430c0
......@@ -4,6 +4,7 @@
#include <vector>
#include <cmath>
#include <string>
#include <utility>
using namespace std;
......@@ -110,7 +111,7 @@ int minutePrompt (int minute) {
} while (true);
}
pair<double,double> altAndAziPair (double altitude, string Direction) {
pair<double,double> altAndAziPair (double altitude, string direction) {
double Azi;
pair<double,double> aziPair;
......@@ -131,30 +132,36 @@ pair<double,double> altAndAziPair (double altitude, string Direction) {
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";
cin >> direction;
if (direction == "North") {
Azi = 0;
break;
} else if (direction == "South") {
Azi = 180;
break;
} else if (direction == "East") {
Azi = 90;
break;
} else if (direction == "West") {
Azi = 270;
break;
} else if (direction == "Northeast") {
Azi = 45;
break;
} else if (direction == "Southeast") {
Azi = 135;
break;
} else if (direction == "Southwest") {
Azi = 225;
break;
} else if (direction == "Northwest") {
Azi = 315;
break;
} else {
cerr << "Error! Please input a valid direction" << endl;
}
} 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;
}
} while (true);
aziPair = make_pair(altitude,Azi);
......
......@@ -15,7 +15,7 @@ int minutePrompt (int minute);
double dateToHour (string month, int day, int hour, int minute);
pair<double,double> altAndAziPair (double altitude, string Direction);
pair<double,double> altAndAziPair (double altitude, string direction);
bool isLeap (int year);
......@@ -2,6 +2,7 @@
#include "Functions.h"
#include <vector>
#include <string>
#include <utility>
using namespace std;
......@@ -9,6 +10,7 @@ int main () {
//variables
string monthInput;
string input3;
string input7;
int monthDay = 0;
int yearInput = 0;
int hourInput = 0;
......@@ -17,6 +19,8 @@ int main () {
int input2 = 0;
int input4 = 0;
int input5 = 0;
double input6;
pair <double,double> testPair;
cout << "==============Welcome to the Star-Gazer v 1.0==============" << endl;
do {
......@@ -29,6 +33,8 @@ int main () {
hourInput = hourPrompt(input4);
minuteInput = minutePrompt(input5);
testPair = altAndAziPair (input6, input7);
} while (false);
//cout << dateToHour(yearInput, monthInput, monthDay, hourInput, minuteInput) << endl;
......
Supports Markdown
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