Gitlab is now using as it's primary address. Please update your bookmarks. FAQ.

Commit c38f7f65 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

Merge branch 'CherryPickHomework' into 'develop'

Cherry pick homework

See merge request R3/school/basic.git.practice!60
parents dcdca610 5f2cd926
Pipeline #9897 passed with stage
function c = addTwoNumbers_DanielDuarte(a, b)
% addTwoNumbers_DanielDuarte(a, b) returns the sum of a and b
c = a + b;
function c = multiplyTwoNumbers_DanielDuarte(a, b)
% multiplyTwoNumbers_DanielDuarte(a, b) returns the product of a and b
c = a * b;
function c = sqrt_DanielDuarte(b)
% sqrt_DanielDuarte(b) takes b and returns the square root of b
c = sqrt(b);
\ No newline at end of file
% Test file
c = addTwoNumbers_DanielDuarte(1, 2)
% test if the addition function works as expected
assert(c == 3)
d = multiplyTwoNumbers_DanielDuarte(c, c)
% test if the multiplication function works as expected
assert(d == 9)
% Test for the homework
% test my sqrt function
assert(sqrt_DanielDuarte(d) == sqrt(d))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment