Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java need flowchart and pseudocode!! public static void main(String args ){ Scanner sc = new Scanner(System.in); System.out.print(Enter the first 12 digits of an ISBN-13 as

Java need flowchart and pseudocode!!

image text in transcribed
public static void main(String args ){ Scanner sc = new Scanner(System.in); System.out.print("Enter the first 12 digits of an ISBN-13 as a string: "); String isbn = sc.next(); if(isbn.length()!=12) System.out.printIn(isbn + " is an invalid input"); }else { int d1 = Integer.parselnt(String. valueOf(isbn.charAt(0))); int d2 = Integer.parseInt(String. valueOf(isbn.charAt(1))); int d3 = Integer.parseInt(String.valueOf(isbn.charAt(2))); int d4 = Integer.parseint(String.valueOf(isbn.charAt(3))); int d5 = Integer.parseInt(String.valueOf(isbn.charAt(4))); int d6 = Integer.parseInt(String.valueOf(isbn.charAt(5))); int d7 = Integer.parseint(String. valueOf(isbn.charAt(6))); int d8 = Integer.parseInt(String.valueOf(isbn.charAt(7))); int d9 = Integer.parseint(String.valueOf(isbn.charAt(8))); int d10 = Integer.parselnt(String.valueOf(isbn.charAt(9))); int d11 = Integer.parseint(String. valueOf(isbn.charAt(10))); int d12 = Integer.parseInt(String.valueOf(isbn.charAt(11))); int checksum = 10 - ((d1 + 3*d2 + d3 + 3*d4 + d5 + 3*d6 + d7 + 3*d8 + d9 + 3*d10 + d11 + 3*d12)% 10); if (checksum==10) checksum=0; System.out.printIn("The ISBN-13 number is "+isbn+checksum)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions