Question: Using c++ Int main ( ) Int ex; count cin >> endl; If (ex == 1) { // All Exercise 1 code Int isbn; }

Using c++
Int main ( )
Int ex;
count
cin >> endl;
If (ex == 1)
{
// All Exercise 1 code
Int isbn;
}
else if (ex == 2)
{
// All Exercise 2 code
}
Return 0;
}
 Using c++ Int main ( ) Int ex; count cin >>
A ten diglt ISBN number uses a checksum as its last diglt to verlfy the first nine digits are valid. Before 2007, all ISBN numbers were composed like this, such as: e-20-5e8005-7 or 1-234-56789-X The first nine digits are assigned by a book's publisher and the last digit is calculated by "weighted sum (described below). The X stands for the checksum value of 10, in order to represent ten as a single digit. You must write a program that calculates and outputs this checksum value given the first nine digits of the ISBN number, utilizing the checksum algorithm below ecksum Algorlthm To compute the weighted sum we start from the left-most digit: Sum one times the first digit, plus two times the second digit, plus three times the third, etc. all the way to nine times the ninth digit. Note: Just becouse we describe the calculation as "starting with the left-most digit" does NOT an that that is the best order for the C+ algorithml Plan carefully for the simplest way of lating each digit from the whole number. Next we take this weighted sum, and calculate the remainder after it is divided by eleven. (i.e. "weighted sum modulo eleven") Finally, the ISBN standard requires that we take this checksum digit and convert it if needed (i.e. 10 is replaced by X). We will omit this step and just output the value from 0 through 10 without any conversion. Your main function must prompt the user to enter the first 9 digits of an ISBN, and then read in that input as a single integer Your program must then calculate the corresponding checksum, and output it as shown in the example run below. Test Values (Single program execution per row) SBN (first 9-digits) 123456789 868880008 987654321 847147063 Checksum Value 16 Examples (1.1 + 2.2 + 3.3 + 4.4 + 5*5+ 6*6 + 7.7 + 8*8 + 9.9)%11-10 (1*0+ 2.0 + 3.0 + 4*0+ 5.0 + 6.0 + 7.0 + 8.0 + 9.0)%11-10 (1.9 + 2*8 + 3.7 + 4*6 + s*5+ 6.4 + 7.3 + 8.2 + 9.1)%11-0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!