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
3bffcb12
Commit
3bffcb12
authored
Mar 14, 2019
by
Brandon Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autosave
parent
4d66494b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
26 deletions
+25
-26
Input stuff/Functions.cpp
Input stuff/Functions.cpp
+13
-7
Input stuff/Functions.h
Input stuff/Functions.h
+6
-6
Input stuff/main.cpp
Input stuff/main.cpp
+6
-13
No files found.
Input stuff/Functions.cpp
View file @
3bffcb12
...
...
@@ -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
...
...
Input stuff/Functions.h
View file @
3bffcb12
...
...
@@ -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
);
Input stuff/main.cpp
View file @
3bffcb12
...
...
@@ -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;
...
...
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