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

  How you need to change the interface and implementation file

Describe how you need to change the interface and implementation files shown in Displays 11.1 and 11.2. You need not write out the files in their entirety.

  What is the longest you might need to watch in order to draw

Will you be able to conclude at some point that the TM is in an infinite loop? If so, what is the longest you might need to watch in order to draw conclusion?

  Complete the definition of the friend subtraction operator

Complete the definition of the member binary operator - in Display 8.2. Complete the definition of the friend subtraction operator - in Display 8.3.

  Write a short memo that describes to the project manager

Write a short memo that describes to the project manager your reason for selecting an n-tiered architecture over a two-tiered architecture. In the memo, give some idea of the different components of the architecture that you would include.

  Name an example of each type of patterns

There are 1) Creational Patterns, 2) Behavioral Patterns. And 3) Structural Patterns HW 19.1 Name an example of each type of patterns.

  How does this watch work with the iphonehow will this be

nbspnbspnbsp bullhow does this watch work with the iphone?nbspnbspnbsp bullhow can this shape future

  Find pair of sequences of same data that could not possibly

Find a pair of sequences of the same data that could not possibly correspond to the preorder and inorder traversals of the same binary tree.

  How many blocks can be stored in each level of the memory

CS 152 Computer Systems Architecture Midterm Examination. How many blocks can be stored in each level of the memory hierarchy

  Data integration and etl

Write down the data integration and ETL. How are they related? What is the data warehouse and state its benefits?

  Modify the application sio it can save the monthgly rainfall

Modify the application sio it can save the monthgly rainfall amounts entered by the user to a file and read the monthly amounts from a file(visual basics).

  List the main feature of the sha cryptographic hash function

List the main features of the SHA-512 cryptographic hash function. What kind of compression function is used in SHA-512?

  Create a month class that has a single data member of month

Create a Month class that has a single data member of month number. Include a member method that returns the name of the month and another method.

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