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

  Determining the format of the number to be entered first

Determining the format of the number to be entered first (binary, decimal and hexadecimal). Access to the other two text boxes outside the relevant text box according to the preferred option

  Discuss protect against rogue employees

What are the technological steps you would take to protect against rogue employees

  Which were very popular in first-generation multi-computers

which were very popular in first-generation multi-computers, being replaced by 2D or 3D meshes or tori in the second and third generations of multi-computers?

  Write a program to test if a given input string containing

Using Stack ADT, write a program to test if a given input string containing the exactly one character ‘

  Implementing compstat

Explain how COMPSTAT, as an information system (IS), implements the four basic IS functions Calculate how information systems have enabled the police departments which implement tools like COMPSTAT in order to respond to the crime faster.

  Is this network on 90 people balanced

According to the de?nitions in this chapter, is this network on 90 people balanced? Give a brief explanation for your answer.

  Single host operating system

This lab is to be used if you're setting up your own lab environment (preferred method of performing the labs) on your own system. The instructions also assume you're using a single host operating system and installing multiple guests in VMWare.

  Create a sum called s2 that adds up all the terms

Program a FOR loop for the index i varying from 2 to n to create a sum called s1 that adds up all the terms in the form of 1/i^d.

  Design a single-bus structure for asc

Change the ASC instruction format to accommodate both preindexed and postindexed indirect addressing. Rewrite the microcode to accommodate those operations.

  Design techniques towards the plugins development

Design techniques towards the plugin's development? Provide authoritative, descriptive, instructional and visual information about the plugin?

  Do you think that this vision explains innovation

Do you think that this vision explains innovation and research in HCI 1998-2017?

  Main window with a game menu

Change your code so that when the purchase button is pressed, a dialog box appears to allow the user to enter purchasing information and to confirm the purchase.

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