Write a c program to compute the check digit for the upc

Assignment Help Computer Engineering
Reference no: EM132194623

Question :

Write a C program to compute the check digit for the UPC.

Do it as follows:

Input digit 1 by itself.

Input digits 2-6 typed as a single 5 digit number, but read it in as 5 single digit numbers.

Input digits 7-11 the same way.

Compute the Checksum as follows: Add the odd digits together in one sum

Add the even digits together as a second sum

Multiply the first sum by three and add it to the second sum

Subtract 1 from this total

Find the remainder when divided by 10

Subtract this remainder from 9.

Print it. The screen should look like( underlined numbers are what you type in):

Enter first digit: 0

Enter first group of five digits: 13800

Enter second group of 5 digits: 15173

Check digit: 5

Try these UPC's: 0 51500 24128

0 31200 01005

Reference no: EM132194623

Questions Cloud

Implement a dynamic queue using car as an object : In a car assembly line, cars move on a belt from station to station in a queue. On each station, various components are attached to the cars.
Write a c program that asks for the users age : Write a C program that asks for the user's age. If it is equal to or greater than 21, print a msg to a file named "Yes.txt" telling the user.
Determine the capacitive reactance of the capacitor : A 145 O resistor is connected in series with a 5.75 µF capacitor. The voltage across the resistor is vR=(1.20V)cos(2500rad/s)t.
Describe how a firm configures its marketing mix : What is meant by a marketing mix? Briefly describe how a firm configures its marketing mix.
Write a c program to compute the check digit for the upc : Write a C program to compute the check digit for the UPC. Compute the Checksum as follows: Add the odd digits together in one sum.
What is the minimum speed that the man must have : A man is going to complete a full vertical loop around a post to which a swing is attached. The swing's rope mass is negligible.
What is the speed of the ball at the lowest point : The figure shows a thin rod, of length L = 1.90 m and negligible mass, that can pivot about one end to rotate in a vertical circle. A heavy ball of mass.
Give the code and screenshot of the code working for user : Give the code and the screenshot of the code working for user input and displayed output printed to the command line by the program.
What is the magnitude of its acceleration in the water : A hailstone traveling with a velocity of 43 meters/second comes to a virtual stop 0.28 seconds after hitting water. What is the magnitude of its acceleration.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Develop and the function that returns the periodic payment

Develop and the function that returns the periodic payment. The amount loaned, rate of interest and the number of payments in a year must be input by the user.

  Why is not function declaration for the function get name

Why isn't the function declaration for the function get Name given in the definition of Salaried Employee?

  Design the decoding circuitry

Arrange the 16 chips needed in the design of Problem (b) as a 4 x 4 array and design the decoding circuitry.

  How your team has decided to address the issues

Discuss issues encountered in the work and how your team has decided to address the issues. Prepare a functional prototype of your application.

  Explaining the rsa

Using the RSA with p = 3, q = 11, e = 7: Explain the suitable value for d? Encode the message “cat” by encrypting each letter separately, i.e., by encrypting ASCII code of each letter.

  Explain quantitative and qualitative communication

Identify and briefly describe the main components of communication system processes. Explain quantitative and qualitative communication.

  Compose two announcements advertising the event to be

social media can be a powerful tool to help you get the word out to a wide audience in a relatively short amount of

  Consider the following snapshot of a system

Problem 1: Consider the following snapshot of a system:

  Describe the usability properties of interactive systems

Building a user interface that meets the needs of a diverse population can be incredibly difficult. Research the best practices for developing a universally.

  Devise and analyze an efficient algorithm for finding

Devise and analyze an efficient algorithm for finding the median. Do the same for n arrays, each with n elements.

  How do we find the optimal pair of children

Now consider the case of Kc = 2. How do we find the optimal pair of children? What is the computational complexity of this task?

  Key differences between information systems and technologies

Next, compare and contrast the key differences between information systems and information technologies. Discuss one to two (1-2) ways in which a company uses management information systems in order to increase organizational efficiency and produc..

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