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

autosave

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