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
Usimov [2.4K]
3 years ago
9

for java ?(Business: check ISBN-13)ISBN-13 is a new standard for identifying books. It uses 13 digits d1d2d3d4d5d6d7d8d9d10d11d1

2d13. The last digit d13 is a checksum, which is calculated from the other digits using the following formula:10 - (d1 + 3d2 + d3 + 3d4 + d5 + 3d6 + d7 + 3d8 + d9 + 3d10 + d11 + 3d12) % 10If the checksum is 10, replace it with 0. Your program should read the input as a string.Display "invalid input" if the input is incorrect.Sample Run 1Enter the first 12 digits of an ISBN-13 as a string: 978013213080The ISBN-13 number is 9780132130806Sample Run 2Enter the first 12 digits of an ISBN-13 as a string: 978013213079The ISBN-13 number is 9780132130790Sample Run 3Enter the first 12 digits of an ISBN-13 as a string: 9780132097801320 is an invalid inputClass Name: Exercise05_47
Computers and Technology
1 answer:
ludmilkaskok [199]3 years ago
6 0

Answer:

In Java:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 String isbn;

 System.out.print("First 1:2 digits: ");

 isbn = input.nextLine();

 if(isbn.length()==12){

 int chksum = 0;

 for(int i = 0; i<12;i++){

     if((i+1)%2==0){      chksum+= 3 * Character.getNumericValue(isbn.charAt(i));          }

     else{          chksum+=Character.getNumericValue(isbn.charAt(i));          }  }

 chksum%=10;

 chksum=10-chksum;

 if(chksum==10){

 System.out.print("The ISBN-13 number is "+isbn+"0");}

 else{

 System.out.print("The ISBN-13 number is "+isbn+""+chksum);          }   }

 else{

     System.out.print("Invalid Input");

 }     }}

Explanation:

See attachment for explanation where comments are used to explain each line

Download txt
You might be interested in
-- of 5 points Question 3 1 try left While designing a new system, a company uncovered several processes that were quite rule-ba
Anna [14]

Answer:

B. robotic process automation.

Explanation:

In the design of a new system, a company was able to uncover several processes that were typically rule-based, and which did not really require staff to control or handle.

Hence, the company chose to automate those processes using robotic process automation so they would no longer need to assign people to perform those tasks.

4 0
2 years ago
Mohammed’s parents learn that his classmates have begun sending him text messages making fun of his heritage. Mohammed says he’s
pychu [463]

Answer:

Mohammed doesn't believe the cyberbullying exists.

Explanation:

If he knew he wouldn't say they are teasing him. I mean, how would their parents know he is being cyberbullied without evidence? Text messages(such as imessages) are most likely on phones, and not on computers.(Unless its an mac I believe.) And they are bullying him; its not using technology positively.

7 0
3 years ago
Read 2 more answers
Which type of vulnerability scan mimics the work of a threat actor who has already exploited a vulnerability and compromised cre
Vilka [71]

There are different type of vulnerability scan. The type of vulnerability scan mimics the work of a threat actor is called Credential Vulnerability Scan.

Credential Vulnerability Scan is known to be a scan in which there is a valid authentication of credentials Example are usernames and passwords etc. are known to be supplied to the vulnerability scanner to mimic the work of a threat actor that has these credentials.

They are known to be very slow but can give an in-depth insight into the system by accessing a wide range of the installed software  

Learn more from

brainly.com/question/14728460

5 0
2 years ago
Information that's been collected to help solve a problem is called
Butoxors [25]

Answer:

Data is the correct answer

5 0
2 years ago
which of these describes a property of all elements A. all elements have six electrons B. all elements are pure substances C. al
sergiy2304 [10]
Im guessing the answer would either B or C
3 0
3 years ago
Other questions:
  • The overall purpose of a food guide is________.
    11·1 answer
  • What is meaning of reboot
    7·2 answers
  • Okay so remember that page I was advertising? At: fol ? Now it's deleted. And idk why because I was doing everything the right w
    7·1 answer
  • Which of the following access control techniques allows the user to feel empowered and able to change security attributes?
    5·1 answer
  • What PowerShell command can be used to clean up old update files on a WSUS server, including unused update files, old revisions,
    10·1 answer
  • Which of the following that can be use to access session variables in PHP?
    14·1 answer
  • What do you expect the future trends of an operating system in terms of (a) cost (b) size (c) multitasking (d) portability (e) s
    12·1 answer
  • What are the differences between Cc &amp; Bcc in emails that are sent ?​
    8·2 answers
  • Please please help I don’t understand this please.
    11·1 answer
  • in the future, mobile technologies are expected to be used more than desktop computers today. what other improvements are helpin
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!