c++ use do while/for loops please dont use string and bool
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.
c++
use do while/for loops
please dont use string and bool
![E.
Test Data:
Test Case Number
1
2
3
ISBN
0-07-021604-5
0-07-201604-5
0-534-37130-2
Valid Or Invalid
Valid
Invalid
Valid](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F2f30caea-e786-4ab4-89a5-81d31b3742e3%2Fa9d70861-2ad4-4fac-ade2-c92114678a37%2Fjp6ddyo_processed.png&w=3840&q=75)
![1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
An international standard book number (ISBN) is used to uniquely identify a book.
It is made of 10 digits, as shown here:
0
The country
The publisher
Write a program that tests an ISBN to see if it is valid.
a.
a.
b.
b.
The tenth digit may be x, which indicates 10.
To determine the weighted sum, the value of each position is multiplied by its relative position,
starting from the right, and the sum of the products is determined.
The callation of the weighted sum for the ISBN shown above is shown in the following table:
Weighted Sum Calculation
Weight
a.
For an ISBN number to be valid, the weighted sum of the 10 digits must be evenly
divisible by 11.
Code
b.
Output:
a.
b.
0
0
7
0
2
1
6
0
4
5
Additional Processing:
Full ISBN: 0-07-021604-5
07
10
9
8
7
6
5
4
3
2
1
Weighted
Value
Weighted Sum: 110
Since the weighted sum modulus 11 is zero, the ISBN number is valid.
The program should validate the input with the following:
That a 10 digit number has been entered.
That none of the numbers entered are negative.
021604
The book number
0
0
56
0
12
5
24
0
8
5
5
The check digit
A loop should be built so that the program can process an unknown quantity of ISBN
validations until the user enters a response that they no longer wish to process another ISBN.
Use a loop that is within the prior described loop to process each character of the ISBN.
A heading explaining the contents of the output.
Display one line per test case containing the ISBN and whether the ISBN is valid or
invalid.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F2f30caea-e786-4ab4-89a5-81d31b3742e3%2Fa9d70861-2ad4-4fac-ade2-c92114678a37%2Faj51edp_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)