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

Merge branch 'homework_diana' into 'develop'

Homework diana

See merge request R3school/git.practice!53
parents 1c1b1e70 815b4fff
Pipeline #8564 failed with stage
function c = addTwoNumbers_myName(a, b) function c = addTwoNumbers_myName(a, b)
% addTwoNumbers_myName(a, b) returns the sum of a and b % addTwoNumbers_diana(a, b) returns the sum of a and b
c = a - b; c = a + b;
end end
function c = multiplyTwoNumbers_diana(a, b)
% multiplyTwoNumbers_diana(a, b) returns the product of a and b
c = a * b;
end
function c = multiplyTwoNumbers_myName(a, b)
% multiplyTwoNumbers_myName(a, b) returns the product of a and b
c = a / b;
end
function y = sqrt_diana(x)
y = sqrt(x);
end
% Test file % Test file
c = addTwoNumbers_myName(1, 2) c = addTwoNumbers_diana(1, 2)
% test if the addition function works as expected % test if the addition function works as expected
assert(c == 3) assert(c == 3)
% d = multiplyTwoNumbers_myName(c, c) d = multiplyTwoNumbers_diana(c, c)
% test if the multiplication function works as expected % test if the multiplication function works as expected
% assert(d == 9) assert(d == 9)
% Test for the homework % Test for the homework
% test my sqrt function % test my sqrt function
% assert(sqrt_myName(d) == sqrt(d)) assert(sqrt_diana(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