Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

ISBN Checker Program Assignment for CS 140 - Prof. Andrew R. Dalton, Assignments of Computer Science

An assignment for cs 140 students in fall 2008 to develop a program that checks the accuracy of international standard book numbers (isbn) by calculating the check symbol based on the first 9 digits and verifying the entered check symbol. Students will learn to work with functions printf and scanf, variables of type int and char, arithmetic operators, for loops, and if statements.

Typology: Assignments

Pre 2010

Uploaded on 08/16/2009

koofers-user-aom
koofers-user-aom 🇺🇸

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download ISBN Checker Program Assignment for CS 140 - Prof. Andrew R. Dalton and more Assignments Computer Science in PDF only on Docsity! CS 140 Fall 2008 Assignment #6: Book Numbers Dr. Andrew R. Dalton October 17th, 2008 1 Overview The purpose of this assignment is to give you some experience working with the functions printf and scanf, variables of type int and char, arithmetic operators, for loops, and if statements. An International Standard Book Number (ISBN) is a unique identifier printed on most books. The identifier consists of 10 symbols (9 numeric digits and 1 check symbol)1. The check symbol is used to detect (some, but not all) errors if one or more of the 9 digits are incorrect. For this assignment, you will develop a program that will check ISBN identifiers for accuracy. Your program will read an ISBN identifier, compute the check symbol based on the first 9 numbers, and verify that the entered check symbol (the 10th symbol) is correct. Example runs of your program might look like: $ ./a.out Enter the 10-symbol ISBN code: 0672326663 The entered ISBN appears to be correct. $ $ ./a.out Enter the 10-symbol ISBN code: 080442957X The entered ISBN appears to be correct. $ $ ./a.out Enter the 10-symbol ISBN code: 055285810X Check symbol mismatch. The entered ISBN is incorrect. Entered check symbol: X Computed check symbol: 2 $ $ ./a.out Enter the 10-symbol ISBN code: 0684324314 Check symbol mismatch. The entered ISBN is incorrect. Entered check symbol: 4 Computed check symbol: 8 $ The program should be saved in a file named isbn.c. 2 Details Your program should read the 10-symbol ISBN identifier one symbol at a time. The first 9 symbols will be numbers, the last symbol will be either a number or an ‘X’. Notice that you cannot read the first 9 symbols as integers – together they would appear to be one large integer! You must first read them as characters and 1On January 1st, 2007 the 10-symbol code was replaced by a 13-symbol code. In this assignment, however, we will be working with the older 10-symbol code. 1
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved