Cody

Solution 1156891

Submitted on 8 Apr 2017 by H M Dipu Kabir
  • Size: 10
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
AB = 43; BC = 55; AC = 66; y = combined_ages(AB,BC,AC); y_correct = [27 16 39]; for i = 1:3 assert(isequal(y(i),y_correct(i))) end

y = 27 16 39 ans = []

2   Pass
AB = 30; BC = 50; AC = 40; y = combined_ages(AB,BC,AC); y_correct = [10 20 30]; for i = 1:3 assert(isequal(y(i),y_correct(i))) end

y = 10 20 30 ans = []

3   Pass
AB = 20; BC = 70; AC = 60; y = combined_ages(AB,BC,AC); y_correct = [5 15 55]; for i = 1:3 assert(isequal(y(i),y_correct(i))) end

y = 5 15 55 ans = []

4   Pass
AB = 34; BC = 84; AC = 56; y = combined_ages(AB,BC,AC); y_correct = [3 31 53]; for i = 1:3 assert(isequal(y(i),y_correct(i))) end

y = 3 31 53 ans = []

5   Pass
y_correct = [2 11 21]; AB = y_correct(1) + y_correct(2); BC = y_correct(2) + y_correct(3); AC = y_correct(1) + y_correct(3); y = combined_ages(AB,BC,AC); for i = 1:3 assert(isequal(y(i),y_correct(i))) end

y = 2 11 21 ans = []

6   Pass
y_correct = [11 17 21]; AB = y_correct(1) + y_correct(2); BC = y_correct(2) + y_correct(3); AC = y_correct(1) + y_correct(3); y = combined_ages(AB,BC,AC); for i = 1:3 assert(isequal(y(i),y_correct(i))) end

y = 11 17 21 ans = []

7   Pass
y_correct = [15 35 55]; AB = y_correct(1) + y_correct(2); BC = y_correct(2) + y_correct(3); AC = y_correct(1) + y_correct(3); y = combined_ages(AB,BC,AC); for i = 1:3 assert(isequal(y(i),y_correct(i))) end

y = 15 35 55 ans = []

Suggested Problems

More from this Author161