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
12bdbd00
Commit
12bdbd00
authored
Dec 06, 2018
by
samuel.boulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
probability and sum function left
parent
a585857a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
13 deletions
+33
-13
Program.java
src/Program.java
+33
-13
No files found.
src/Program.java
View file @
12bdbd00
...
@@ -63,6 +63,29 @@ public class Program {
...
@@ -63,6 +63,29 @@ public class Program {
};
};
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
int
[]
input
=
{
3
,
6
,
77
};
double
output
=
0.0
;
double
bracketsResult
=
0.0
;
double
powerResult
=
0.0
;
double
total
=
0.0
;
for
(
int
i
=
0
;
i
<
input
.
length
;
i
++)
{
bracketsResult
=
(
double
)
input
[
i
]
/
2
;
System
.
out
.
println
(
bracketsResult
+
" bracket result"
);
powerResult
=
Math
.
pow
(
bracketsResult
,
i
/
2
);
System
.
out
.
println
(
i
+
" this is i"
);
System
.
out
.
println
(
powerResult
+
" this is powerResult"
);
total
=
total
+
powerResult
;
System
.
out
.
println
(
total
+
" this is total"
);
}
output
=
total
/
input
.
length
+
3
;
System
.
out
.
println
(
output
+
" output"
);
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
...
@@ -212,7 +235,7 @@ public class Program {
...
@@ -212,7 +235,7 @@ public class Program {
}
}
public
static
int
[]
Difference
(
int
[]
intArrayA
,
int
[]
intArrayB
)
{
public
static
int
[]
Difference
(
int
[]
intArrayA
,
int
[]
intArrayB
)
{
// DONE AND PASSED TEST
ArrayList
<
Integer
>
differenceList
=
new
ArrayList
<
Integer
>();
ArrayList
<
Integer
>
differenceList
=
new
ArrayList
<
Integer
>();
...
@@ -503,27 +526,24 @@ public static int Range (int[] input) {
...
@@ -503,27 +526,24 @@ public static int Range (int[] input) {
public
static
double
ComplexSumFunctionA
(
int
[]
input
)
{
public
static
double
ComplexSumFunctionA
(
int
[]
input
)
{
// ASK MATT
// ASK MATT
// email david.
double
output
=
0.0
;
double
output
=
0.0
;
double
sum
=
0.0
;
double
bracketsResult
=
0.0
;
double
sum2
=
0.0
;
double
powerResult
=
0.0
;
double
sum3
=
0.0
;
double
total
=
0.0
;
for
(
int
i
=
0
;
i
<
input
.
length
;
i
++)
for
(
int
i
=
0
;
i
<
input
.
length
;
i
++)
{
{
sum
+=
input
[
i
]
/
2
;
bracketsResult
=
input
[
i
]
/
2
;
sum2
+=
Math
.
pow
(
sum
,
i
/
2
);
powerResult
=
Math
.
pow
(
bracketsResult
,
i
/
2
);
total
=
total
+
powerResult
;
}
}
sum3
=
input
.
length
+
3
;
output
=
sum2
/
sum
3
;
output
=
total
/
input
.
length
+
3
;
return
output
;
return
output
;
}
}
public
static
int
[][]
MatrixScalarMultiplication
(
int
[][]
matrix
,
int
scalar
){
public
static
int
[][]
MatrixScalarMultiplication
(
int
[][]
matrix
,
int
scalar
){
int
[][]
resultMatrix
=
new
int
[
matrix
.
length
][
matrix
[
0
].
length
];
int
[][]
resultMatrix
=
new
int
[
matrix
.
length
][
matrix
[
0
].
length
];
...
...
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