Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(35 points) Using JavaScript only, create a function that validates ISBN-10 values. The ISBN format is as follows: 0-000-00000-0 The first nine digits (excluding the

image text in transcribed

(35 points) Using JavaScript only, create a function that validates ISBN-10 values. The ISBN format is as follows: 0-000-00000-0 The first nine digits (excluding the dashes) can be any digit (0-9), whereas the last digit can be also any digit from 09 plus one check character ( X, which represents 10). ISBN10 can be validated with the following formula: (n110+n29+n38+n47+n56+n65+n74+n83+n92+n101)mod11==0 Where n1 to n10 represents the corresponding digits. If the result is 0 , the ISBN-10 is valid (and the function must return true, otherwise false). Keep in mind that the function must take the ISBN-10 value as a parameter. For example: If the ISBN value is 3-598-21508-8: (310+59+98+87+26+15+54+03+82+81)mod11==0 The function must return true since it is a valid ISBN. Another example: 3-598-21507-X (Don't forget that X represents "10") (310+59+98+87+26+15+54+03+72+101)mod11==0 This function will also return true

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

10. Microsoft Corporation

Answered: 1 week ago

Question

4. EMC Corporation

Answered: 1 week ago