Commit 3bffcb12 authored by Brandon Reid's avatar Brandon Reid

autosave

parent 4d66494b
......@@ -9,7 +9,8 @@
using namespace std;
// Input checking functions
int yearPrompt (int year) {
int yearPrompt () { // empty argument
int year = 0;
do {
cout << "Enter year: ";
if (!(cin >> year)) { // validates that numbers were entered and checks input
......@@ -31,7 +32,8 @@ int yearPrompt (int year) {
} while (true);
}
string monthPrompt (string month) {
string monthPrompt () {
string month;
do {
cout << "Enter month: ";
cin >> month;
......@@ -43,7 +45,8 @@ string monthPrompt (string month) {
} while (true);
}
int dayPrompt (string month, int day, int year) {
int dayPrompt (string month, int year) {
int day = 0;
do {
cout << "Enter day: ";
if (!(cin >> day)) { // validates that numbers were entered and checks input
......@@ -77,7 +80,8 @@ int dayPrompt (string month, int day, int year) {
} while (true);
}
int hourPrompt (int hour) {
int hourPrompt () {
int hour = 0;
do {
cout << "Enter hour (0 - 23): ";
if (!(cin >> hour)) { // validates that numbers were entered and checks input
......@@ -94,7 +98,8 @@ int hourPrompt (int hour) {
} while (true);
}
int minutePrompt (int minute) {
int minutePrompt () {
int minute = 0;
do {
cout << "Enter minute: ";
if (!(cin >> minute)) { // validates that numbers were entered and checks input
......@@ -111,10 +116,11 @@ int minutePrompt (int minute) {
} while (true);
}
pair<double,double> altAndAziPair (double altitude, string direction) {
pair<double,double> altAndAziPair () {
double altitude = 0;
double Azi;
string direction;
pair<double,double> aziPair;
do {
cout << "Enter the altitude at which you are looking (0-90): ";
if (!(cin >> altitude)) { // validates that numbers were entered and checks input
......
......@@ -2,20 +2,20 @@
using namespace std;
int yearPrompt (int year);
int yearPrompt ();
string monthPrompt (string month);
string monthPrompt ();
int dayPrompt (string month, int day, int year);
int dayPrompt (string month, int year);
int hourPrompt (int hour);
int hourPrompt ();
int minutePrompt (int minute);
int minutePrompt ();
double dateToHour (string month, int day, int hour, int minute);
pair<double,double> altAndAziPair (double altitude, string direction);
pair<double,double> altAndAziPair ();
bool isLeap (int year);
......@@ -9,32 +9,25 @@ using namespace std;
int main () {
//variables
string monthInput;
string input3;
string input7;
int monthDay = 0;
int yearInput = 0;
int hourInput = 0;
int minuteInput = 0;
int input1 = 0;
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 {
yearInput = yearPrompt(input1);
yearInput = yearPrompt();
monthInput = monthPrompt(input3);
monthInput = monthPrompt();
monthDay = dayPrompt(monthInput, input2, yearInput);
monthDay = dayPrompt(monthInput, yearInput);
hourInput = hourPrompt(input4);
hourInput = hourPrompt();
minuteInput = minutePrompt(input5);
minuteInput = minutePrompt();
testPair = altAndAziPair (input6, input7);
testPair = altAndAziPair ();
} while (false);
//cout << dateToHour(yearInput, monthInput, monthDay, hourInput, minuteInput) << endl;
......
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