Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
school
git
basic-practice
Commits
c88378aa
Commit
c88378aa
authored
Jan 30, 2019
by
Laurent Heirendt
✈
Browse files
Merge branch 'homework_AliceOldano' into 'develop'
Homework alice oldano See merge request R3school/git.practice!52
parents
526a3ff5
8b5112e7
Pipeline
#8545
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/firstCommit/addTwoNumbers_
myName
.m
→
src/firstCommit/addTwoNumbers_
AliceOldano
.m
View file @
c88378aa
function
c
=
addTwoNumbers_
myName
(
a
,
b
)
function
c
=
addTwoNumbers_
AliceOldano
(
a
,
b
)
% addTwoNumbers_myName(a, b) returns the sum of a and b
c
=
a
-
b
;
c
=
a
+
b
;
end
src/secondCommit/multiplyTwoNumbers_
myName
.m
→
src/secondCommit/multiplyTwoNumbers_
AliceOldano
.m
View file @
c88378aa
function
c
=
multiplyTwoNumbers_
myName
(
a
,
b
)
function
c
=
multiplyTwoNumbers_
AliceOldano
(
a
,
b
)
% multiplyTwoNumbers_myName(a, b) returns the product of a and b
c
=
a
/
b
;
c
=
a
*
b
;
end
src/thirdCommit/sqrt_AliceOldano.m
0 → 100644
View file @
c88378aa
function c = sqrt_AliceOldano(d)
c = d^(1/2);
end
\ No newline at end of file
test/suite/test_
myName
.m
→
test/suite/test_
AliceOldano
.m
View file @
c88378aa
% Test file
c
=
addTwoNumbers_myName
(
1
,
2
)
c
=
addTwoNumbers_AliceOldano
(
1
,
2
)
% test if the addition function works as expected
assert
(
c
==
3
)
%
d = multiplyTwoNumbers_
myName
(c, c)
d
=
multiplyTwoNumbers_
AliceOldano
(
c
,
c
)
% test if the multiplication function works as expected
%
assert(d == 9)
assert
(
d
==
9
)
% Test for the homework
e
=
sqrt_AliceOldano
(
d
)
% test my sqrt function
%
assert(
sqrt_myName(d)
== sqrt(d))
assert
(
e
==
sqrt
(
d
))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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