Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
Project 3 Star Gazing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eric Walsh
Project 3 Star Gazing
Commits
238c48fd
Commit
238c48fd
authored
Mar 13, 2019
by
Brandon Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autosave
parent
4e9430c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
25 deletions
+38
-25
Input stuff/Functions.cpp
Input stuff/Functions.cpp
+31
-24
Input stuff/Functions.h
Input stuff/Functions.h
+1
-1
Input stuff/main.cpp
Input stuff/main.cpp
+6
-0
No files found.
Input stuff/Functions.cpp
View file @
238c48fd
...
...
@@ -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
D
irection
)
{
pair
<
double
,
double
>
altAndAziPair
(
double
altitude
,
string
d
irection
)
{
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
);
...
...
Input stuff/Functions.h
View file @
238c48fd
...
...
@@ -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
D
irection
);
pair
<
double
,
double
>
altAndAziPair
(
double
altitude
,
string
d
irection
);
bool
isLeap
(
int
year
);
Input stuff/main.cpp
View file @
238c48fd
...
...
@@ -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;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment