Commit 52ab7c72 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

Merge branch 'homework_BUSI' into 'develop'

Homework busi

See merge request R3school/git.practice!49
parents ed9c9217 80e20b3a
Pipeline #8594 failed with stage
function c = addTwoNumbers_BUSI(a, b)
% addTwoNumbers_BUSI(a, b) returns the sum of a and b
c = a + b;
function c = multiplyTwoNumbers_BUSI(a, b)
% multiplyTwoNumbers_BUSI(a, b) returns the product of a and b
c = a * b;
function c = sqrt_BUSI(d)
% sqrt_BUSI(d) returns the square root of d
c = sqrt(d);
\ No newline at end of file
% Test file
c = addTwoNumbers_BUSI(1, 2)
% test if the addition function works as expected
assert(c == 3)
d = multiplyTwoNumbers_BUSI(c, c)
% test if the multiplication function works as expected
assert(d == 9)
% Test for the homework
% test my sqrt function
assert(sqrt_BUSI(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