Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use printf and scanf if its required 2. Write a program to test an ISBN number to see if it is valid using the

please use printf and scanf if its requiredimage text in transcribed

2. Write a program to test an ISBN number to see if it is valid using the weighted sum method. Weighted sum method: Declare two arrays with ten elements each. Enter the 10 digits of an ISBN number in one array, one digit in each array slot. In the second array enter weighting factors from 10 to 1 as shown in the table below. You may choose to have a third array with weighted values (products of corresponding elements of the other two arrays. The ISBN number is valid ifthe sum of the weighted values modulus 1 l is O. An le is shown in the table below for ISBN number 0078818095 ISBN digit Weighted Value Weight 10 56 56 48 32 18 220 4 Weighted Sum Table 1. Weighted Sum Method for ISBN Validity Test For two extra points test the validity of the ISBN number by the Sum of Sums method. Sum of Sums: In this method the original ISBN array is used again. A second array is created by adding each digit of the ISBN array to the sum of the previous digits. A third array is the sum of the previous sums. The ISBN number is valid if the sum of the sums modulus 11 is 0. An example is shown below ISBN digit Sum of Di Sum of Sums 15 23 24 32 32 41 46 45 69 101 133 174 220 Table2. Sum of Sums Method for ISBN Validity Test Problem adapter from Computer Science A Structured Programming Approach Using C by Forouzan & Glberg 2. Write a program to test an ISBN number to see if it is valid using the weighted sum method. Weighted sum method: Declare two arrays with ten elements each. Enter the 10 digits of an ISBN number in one array, one digit in each array slot. In the second array enter weighting factors from 10 to 1 as shown in the table below. You may choose to have a third array with weighted values (products of corresponding elements of the other two arrays. The ISBN number is valid ifthe sum of the weighted values modulus 1 l is O. An le is shown in the table below for ISBN number 0078818095 ISBN digit Weighted Value Weight 10 56 56 48 32 18 220 4 Weighted Sum Table 1. Weighted Sum Method for ISBN Validity Test For two extra points test the validity of the ISBN number by the Sum of Sums method. Sum of Sums: In this method the original ISBN array is used again. A second array is created by adding each digit of the ISBN array to the sum of the previous digits. A third array is the sum of the previous sums. The ISBN number is valid if the sum of the sums modulus 11 is 0. An example is shown below ISBN digit Sum of Di Sum of Sums 15 23 24 32 32 41 46 45 69 101 133 174 220 Table2. Sum of Sums Method for ISBN Validity Test Problem adapter from Computer Science A Structured Programming Approach Using C by Forouzan & Glberg

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

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

11. Identify the apotheosis in Indiana Jones and the Last Crusade.

Answered: 1 week ago

Question

4-6 Is there a digital divide? If so, why does it matter?

Answered: 1 week ago