Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
assessment 1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rehman.khan
assessment 1
Commits
7a1442e4
Commit
7a1442e4
authored
Jan 11, 2019
by
rehman.khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assess
parent
65f6bc1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
AssessmentPartOne.java
src/AssessmentPartOne.java
+12
-0
No files found.
src/AssessmentPartOne.java
View file @
7a1442e4
...
...
@@ -8,6 +8,9 @@ public class AssessmentPartOne {
// Add comments beside any changes you make
if
((
num1
>
num3
)
&&
(
num1
>
num2
))
// this if statement means hat if num1 is greater than num3
// and num1 is greater than num2 return num1
{
return
num1
;
...
...
@@ -16,6 +19,8 @@ public class AssessmentPartOne {
else
if
((
num2
>
num3
)
&&
(
num2
>
num1
))
{
return
num2
;
// if that isnt the case then if num2 is greater than num3
// and num2 is greater than num1 return num2
}
else
return
num3
;
...
...
@@ -36,14 +41,21 @@ public class AssessmentPartOne {
int
sumOfSquares
=
0
;
if
((
end
>=
0
)
&&
(
start
>=
0
)
&&
(
start
<
end
)
&&
(
end
>
start
+
1
))
// to compare to see if start and end are integer variables
// comparing that start is smaller than end
// and there are intergers between both variables
{
for
(
int
p
=
start
+
1
;
p
<
end
;
p
++)
// if the statements are true a loop can be used
// to add the numbers between start and end.
{
}
}
else
return
-
1
;
// if all statements are false then return the value of -1
return
sumOfSquares
;
...
...
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