Cody

Problem 45486. Check Digit - 01

Solution 3446398

Submitted on 28 Oct 2020 by Mehmet OZC
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_01('030640615'),2))

x = '030640615'

2   Pass
assert(isequal(ISBN_01('0306406152'),'invalid'))

x = '0306406152'

3   Pass
assert(isequal(ISBN_01('014298118'),4))

x = '014298118'

4   Pass
assert(isequal(ISBN_01('014298115'),'X'))

x = '014298115'

5   Pass
assert(isequal(ISBN_01('85-359-0277'),5))

x = '853590277'

6   Pass
assert(isequal(ISBN_01('978-85-359-0277'),'invalid'))

x = '978853590277'

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!