Comment your code and use procedural decomposition

Assignment Help Computer Engineering
Reference no: EM132200529

Question :

Write a Java program that asks the user for a EAN13 and validates it as either correct or incorrect (display a message accordingly).

Your program should continue to run, to validate multiple EAN13 numbers, until the user decides to exit the program, by entering 'Q' or 'Quit'.

Comment your code and use procedural decomposition problem solving techniques.

If EAN13 is 4006381333931 the check code is computed as follows:

Calculation
First 12 digits of the barcode 4 0 0 6 3 8 1 3 3 3 9 3
Weights 1 3 1 3 1 3 1 3 1 3 1 3
Multiplied by weight 4 0 0 18 3 24 1 9 3 9 9 9
Sum










89

The nearest multiple of 10 that is equal or higher than the sum, is 90. Subtract them: 90 - 89 = 1, this is the last digit of the barcode.

Reference no: EM132200529

Questions Cloud

Convert a base-10 number to a base-2 number : Write a Java or C/C++ program to convert a base-10 number to a base-2 number.
Write a java method to take a positive integer value : Write a java method to take a positive integer value as its parameter and returns a string of 1s and 0s that represents its binary value.
What do you notice about the percentages : Write a java program that allows user to enter the number of numbers to generate random integers between 0 to 9 and displays the count of each numbers.
Write a java implementation for the following problem : Write a Java implementation for the following problem. You can make use of whichever of the ADTs Stack, Queue, and Deque that you need.
Comment your code and use procedural decomposition : Write a Java program that asks the user for a EAN13 and validates it as either correct or incorrect (display a message accordingly).
How to write java code for a program that loads a map : How to write JAVA code for a program that loads a map from a text file and draws a rectangle that moves corresponding.
Generate the two-dimensional string array : Declare and initialize the 2 dimensional array a b c d e f g h i Next print one diagonal of this "determinant" on one line.
Prepare a method to multiply two n times n matrices : Write a Java method to multiply two N times N matrices (2D arrays). The two matrices are received as parameters.
Write a java method which takes a 2-darray of double : Write a Java method, findAverages, which takes a 2-dimensional array of double as a parameter and returns a 1-dimensional array of double containing.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Describe at least five standard internet and web protocols

Describe at least five standard Internet and Web protocols. Which Internet and Web protocols are used, and how are they used?

  Create appropriate derived classes to support about animals

Use a base class Pet with abstract functions and create appropriate derived classes to support about 10 animals of your choice.

  How to defend against attacker on the web

Even just talking on the phone can be a security risk, according to Harwood, there will be a slight increase in risk due to all the vulnerabilities

  Create a project in which the input is the number of minutes

A local recording studio rents its facilities for $200 per hour. Management charges only for the number of minutes used. Create a project in which the input is the number of minutes it used the studio.

  Provide a student with a tool to use to properly identify

The purpose of this project is to provide a student with a tool to use to properly identify, count, grade and average students' scores in a course.

  Create a hierarchy of five of the most important topics

Create a hierarchy of five (no more or no less) of the most important topics that you feel need to be addressed in this one-day course that best fits.

  Explain why modem block ciphers are designed

Explain why modem block ciphers are designed as substitution ciphers instead of transposition ciphers.

  Give the heap that results when starting with an empty heap

Give the heap that results when, starting with an empty heap, insert is called successively for the keys EASY QUESTION.

  Whats the relation for the training data set

What's the relation for the training data set and How many instances in the data set? How many attributes are in the relation?

  Why might a user or administrator disable dep

Investigate buffer overflows and DEP. How does DEP prevent malicious attacks via buffer overflows? Is it always effective? Why might a user or administrator disable DEP?

  Questionmicrosoft windows server 2008 network

questionmicrosoft windows server 2008 network infrastructure configuration case studyyou work for a company that has

  Develop a system that scales the temperture

Develop a system that scales the temperture into 0 - 5V for input to an 8-bit ADC and a computer control system

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd