Cody

Problem 44939. What time can I drive after drinking?

Solution 1892802

Submitted on 6 Aug 2019
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   Fail
T = 19; N = 1; D_correct = 0; H_correct = 20; [D,H]=driveTime(T,N) assert(isequal(D,D_correct)) assert(isequal(H,H_correct))

H = 20

Output argument "D" (and maybe others) not assigned during call to "driveTime". Error in Test1 (line 6) [D,H]=driveTime(T,N)

2   Fail
T = 17; N = 5; D_correct = 1; H_correct = 6; [D,H]=driveTime(T,N) assert(isequal(D,D_correct)) assert(isequal(H,H_correct))

H = 6

Output argument "D" (and maybe others) not assigned during call to "driveTime". Error in Test2 (line 6) [D,H]=driveTime(T,N)

3   Fail
T = 19; N = 10; D_correct = 1; H_correct = 23; [D,H]=driveTime(T,N) assert(isequal(D,D_correct)) assert(isequal(H,H_correct))

H = 23

Output argument "D" (and maybe others) not assigned during call to "driveTime". Error in Test3 (line 6) [D,H]=driveTime(T,N)

4   Fail
T = 23; N = 20; D_correct = 3; H_correct = 9; [D,H]=driveTime(T,N) assert(isequal(D,D_correct)) assert(isequal(H,H_correct))

H = 9

Output argument "D" (and maybe others) not assigned during call to "driveTime". Error in Test4 (line 6) [D,H]=driveTime(T,N)

Suggested Problems

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!