1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
USPshnik [31]
3 years ago
9

ISBN-13 is a new standard for identifying books. It uses 13 digits d1d2d3d4d5d6d7d8d9d10d11d12d13. The last digit d13 is a check

sum, which is calculated from the other digits using the following formula: 10 - (d1 3d2 d3 3d4 d5 3d6 d7 3d8 d9 3d10 d11 3d12) % 10 If the checksum is 10, replace it with 0. Your program should read the input as a string.

Computers and Technology
1 answer:
qwelly [4]3 years ago
5 0

Answer:

// Scanner class is imported to allow program

// read input from user

import java.util.Scanner;

// Solution class is created

public class Solution {

// main method that begin program execution

public static void main(String[] strings) {

// Scanner object scan is created

// it receive input via the keyboard

Scanner scan = new Scanner(System.in);

// a prompt is displayed for user to enter 12 digits of ISBN

System.out.print("Enter the first 12 digits of an ISBN as string: ");

// user input is assigned to input

String input = scan.next();

//if length of input is not 12, program display error message and quit

if (input.length() != 12) {

System.out.println(input + " is Invalid input");

System.exit(0);

}

// 0 is assigned to checkSum

int checkSum = 0;

// for loop that goes through the string and does the computation

for (int i = 0; i < input.length(); i++) {

// if the index is even

if ((i + 1) % 2 == 0) {

checkSum += (input.charAt(i) - '0') * 3;

}

// if the index is odd

else

{

checkSum += input.charAt(i) - '0';

}

}

// modulo 10 of checkSum is assigned to checkSum

checkSum %= 10;

// checkSum is substracted from 10

checkSum = 10 - checkSum;

// if checkSum equals 10, 0 is concatenated with input

// else input is concatenated with checkSum

if (checkSum == 10) input += "0";

else input += checkSum;

// the new value of the isbn-13 is displayed

System.out.println("The ISBN-13 number is " + input);

}

}

Explanation:

The program is written in Java and well commented.

A sample of program output during execution is also attached.

You might be interested in
How to upload themes to chrome web store
Advocard [28]
You need to go to the chrome web store, filter your search for themes, search what kind you are looking for, and then add the extension. 
3 0
3 years ago
Network architecture is the pattern in which and other devices are set up to communicate. It specifies how from one computer mov
yanalaym [24]

Answer:

1) a.-Computers

b.- cables

c.-switches

2) a.- data

b.- devices

c.- computers

4 0
3 years ago
Aubrey uses the following formula to calculate a required value. Which elements of the formula use mixed cell referencing?
iris [78.8K]

Answer:

$1A

brainiest plz

Explanation:

The elements of a formula only can have the following format:

1) Letter Number as C1

2) Letter $ Number as A$1

3) $ Letter Number as $A1

4) $ Letter $ Number as $A$1

The element $1A is not in the format

5 0
3 years ago
Read 2 more answers
The pound sign (#) is the syntax used by excel to indicate that a cell reference is absolute.
kati45 [8]
False. I think the $ sign is used for that. e.g. $A$4.
5 0
3 years ago
Which database property type increases the efficiency of a search on the designated field in the physical database?
RUDIKE [14]

Answer: Indexed

Explanation: Indexed property in the database system is for indexing .In this process reduction of the record/disk numbers results in the increase in the optimized performance. The structure of the index is in column form.

This technique rapidly provides the data from the table containing database when every query arises or requirement is proposed. Therefore the efficiency of the database increases.

Other options are incorrect because validation rule and text are regarding the  verification of the data user and text respectively and expression is defined as the group of one or more value.Thus the correct option is indexed.

4 0
3 years ago
Other questions:
  • Work AreaWhen creating a program in Visual Studio, the windows form object you are designing will appear in the _________ of the
    7·1 answer
  • How to get back to previous page with no data lost in c# windows form application?
    9·1 answer
  • Using the drop-down menu, complete the following questions based on your knowledge of variables. is a value that can be used onl
    7·1 answer
  • Why process scheduling is needed in a uni-processor system?
    12·1 answer
  • Write a program that accepts a whole number as input, multiplies that number by 12, and then outputs the product
    5·2 answers
  • What direction would you travel to go from japan to the united states
    14·1 answer
  • The Middle East links which two countries
    10·2 answers
  • PYTON CODERS I NEED HELP I WILL GIVE BRAINLIEST!!! Why is this python code giving me problems?
    12·1 answer
  • Select the correct answer.
    13·1 answer
  • Write long answer to the following question. a. Define microcomputer. Explain the types of microcomputers in detail.​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!