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]
2 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]2 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
What is the generic term for a device that stores images for long periods of time?
Artemon [7]
I would say 1. Backup drive.
7 0
2 years ago
Read 2 more answers
When conducting research on the internet, what is a starting point for determining how to start the research?
Alex787 [66]
It depends on what you're researching for.
4 0
3 years ago
Why is iot architecture important?
Harlamova29_29 [7]
They need to make sure your building is easy to move around in. Beyond the building itself, architecture and design can help bring balance to people's lives. ... Well-designed schools create better learning environments. Workplaces with good architecture experience higher productivity.
7 0
3 years ago
after a few weeks of using facial recognition login, your infrared camera fails, and you are asked to enter your pin. because it
riadik2000 [5.3K]

The reason that you have not been locked out after several failed PIN login attempts is that your laptop does not have a TPM chip, and you have not set up BitLocker for lockout.

Technology known as Trusted Platform Module (TPM) is made to offer hardware-based, security-related functionality. Designed to perform cryptographic operations, a TPM chip is a safe crypto-processor. Malicious software cannot interfere with the TPM's security capabilities, and the chip has numerous physical security features to prevent tampering. Utilizing TPM technology has a number of major benefits, including the following:

  • Cryptographic keys should be created, stored, and used sparingly.
  • Utilize the burnt-in RSA key of the TPM to authenticate platform devices using TPM technology.
  • By recording security metrics, you can assist in ensuring platform integrity.

To learn more about TPM click here:

brainly.com/question/10742732

#SPJ4

7 0
10 months ago
You check the ip address on a host on the network. the address is 122.16.155.71 with a mask of 255.0.0.0. what is the broadcast
Sveta_85 [38]
122.255.255.255






--------------------------------
8 0
3 years ago
Other questions:
  • The illustrations group contains all but a _______​
    9·1 answer
  • Define an I/O port. Which functions are performed by it?
    10·1 answer
  • How do you mark peoples answer as the brainliest answer? I have trouble doing so. Please help!
    10·2 answers
  • 2. Which one of the following is not a feature of technology?
    10·1 answer
  • In this lab, your task is to complete the following: Enable all of the necessary ports on each networking device that will allow
    9·1 answer
  • NEED ANSWER ASAP. CORRECT ANSWER GETS BRAINLIEST! TY
    5·1 answer
  • Give me at least five main characteristic of irrigation equipment​
    8·1 answer
  • Why don’t the ads on Brainly load anymore
    14·2 answers
  • A search for reliable information is a search for what?
    14·1 answer
  • Send link for a qc or paddle
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!