Cody

Problem 45487. Check Digit - 02

Solution 2247384

Submitted on 30 Apr 2020 by Yuan
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
assert(isequal( ISBN_check_2('1306406152'),0))

ans = logical 0

2   Pass
assert(isequal( ISBN_check_2('0306406152'),1))

ans = logical 1

3   Pass
assert(isequal( ISBN_check_2('014298115X'),1))

ans = logical 1

4   Pass
assert(isequal( ISBN_check_2('014298115S'),0))

ans = logical 0

5   Pass
assert(isequal( ISBN_check_2('0X306406152'),0))

6   Pass
assert(isequal( ISBN_check_2('978-0-306-40615-7'),1))

ans = logical 1

7   Pass
assert(isequal( ISBN_check_2('978-0-306-40615-X'),0))

ans = logical 0

8   Pass
assert(isequal( ISBN_check_2('978-306-40615-7'),0))

9   Pass
assert(isequal( ISBN_check_2('0-9752298-0-X'),1))

ans = logical 1

10   Pass
assert(isequal( ISBN_check_2('0-97R2298-0-328'),0))

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!