Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Maths1
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
samuel.boulton
Maths1
Commits
9a8a7f15
Commit
9a8a7f15
authored
Dec 10, 2018
by
samuel.boulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sum done.
parent
12bdbd00
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Program.java
src/Program.java
+8
-8
No files found.
src/Program.java
View file @
9a8a7f15
...
@@ -71,10 +71,10 @@ public class Program {
...
@@ -71,10 +71,10 @@ public class Program {
double
total
=
0.0
;
double
total
=
0.0
;
for
(
int
i
=
0
;
i
<
input
.
length
;
i
++)
for
(
int
i
=
0
;
i
<
input
.
length
;
i
++)
{
{
bracketsResult
=
(
double
)
input
[
i
]
/
2
;
bracketsResult
=
(
double
)
input
[
i
]
/
2
.0
;
System
.
out
.
println
(
bracketsResult
+
" bracket result"
);
System
.
out
.
println
(
bracketsResult
+
" bracket result"
);
powerResult
=
Math
.
pow
(
bracketsResult
,
i
/
2
);
powerResult
=
Math
.
pow
(
bracketsResult
,
i
/
2
.0
);
System
.
out
.
println
(
i
+
" this is i"
);
System
.
out
.
println
(
i
+
" this is i"
);
System
.
out
.
println
(
powerResult
+
" this is powerResult"
);
System
.
out
.
println
(
powerResult
+
" this is powerResult"
);
...
@@ -83,7 +83,7 @@ public class Program {
...
@@ -83,7 +83,7 @@ public class Program {
}
}
output
=
total
/
input
.
length
+
3
;
output
=
total
/
(
double
)(
input
.
length
+
3.0
)
;
System
.
out
.
println
(
output
+
" output"
);
System
.
out
.
println
(
output
+
" output"
);
// TODO Auto-generated method stub
// TODO Auto-generated method stub
...
@@ -526,26 +526,26 @@ public static int Range (int[] input) {
...
@@ -526,26 +526,26 @@ public static int Range (int[] input) {
public
static
double
ComplexSumFunctionA
(
int
[]
input
)
{
public
static
double
ComplexSumFunctionA
(
int
[]
input
)
{
//
ASK MATT // email david.
//
DONE AND PASSED TEST
double
output
=
0.0
;
double
output
=
0.0
;
double
bracketsResult
=
0.0
;
double
bracketsResult
=
0.0
;
double
powerResult
=
0.0
;
double
powerResult
=
0.0
;
double
total
=
0.0
;
double
total
=
0.0
;
for
(
int
i
=
0
;
i
<
input
.
length
;
i
++)
for
(
int
i
=
0
;
i
<
input
.
length
;
i
++)
{
{
bracketsResult
=
input
[
i
]
/
2
;
bracketsResult
=
(
double
)
input
[
i
]
/
2.0
;
powerResult
=
Math
.
pow
(
bracketsResult
,
i
/
2
);
powerResult
=
Math
.
pow
(
bracketsResult
,
i
/
2
.0
);
total
=
total
+
powerResult
;
total
=
total
+
powerResult
;
}
}
output
=
total
/
input
.
length
+
3
;
output
=
total
/
(
double
)(
input
.
length
+
3
)
;
return
output
;
return
output
;
}
}
public
static
int
[][]
MatrixScalarMultiplication
(
int
[][]
matrix
,
int
scalar
){
public
static
int
[][]
MatrixScalarMultiplication
(
int
[][]
matrix
,
int
scalar
){
// DONE AND PASSED TEST
int
[][]
resultMatrix
=
new
int
[
matrix
.
length
][
matrix
[
0
].
length
];
int
[][]
resultMatrix
=
new
int
[
matrix
.
length
][
matrix
[
0
].
length
];
for
(
int
i
=
0
;
i
<
matrix
.
length
;
i
++)
for
(
int
i
=
0
;
i
<
matrix
.
length
;
i
++)
...
...
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