473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

p_variable in ISBN sorting program

Hi, I am new to C++ so bear with me a little bit. I am looking at a sample program for an isbn check. The first nine digits are supposed to be multiplied by a weight, added together and then divided by 11 and that should give you the 10th number or the check number.

So in the sample, the user inputs the number and it is stored in an array called isbn, the main function calls calcRemainder(bookNo). I look further down the program at the next function and it reads

long calcRemainder(char p_isbn)

What does this mean?
Oct 2 '07 #1
3 1968
gpraghuram
1,275 Expert 1GB
Hi, I am new to C++ so bear with me a little bit. I am looking at a sample program for an isbn check. The first nine digits are supposed to be multiplied by a weight, added together and then divided by 11 and that should give you the 10th number or the check number.

So in the sample, the user inputs the number and it is stored in an array called isbn, the main function calls calcRemainder(bookNo). I look further down the program at the next function and it reads

long calcRemainder(char p_isbn)

What does this mean?
As u have explained the processing of first 9 characters shuld give the 10 th character and thst what the fucntion does.
This is my guess.
If u can post the code then i can comment on it more

Raghuram
Oct 3 '07 #2
Studlyami
464 Expert 256MB
At first that looked like a function definition, but putting it into code the complier likes it. It says that its creating a long datatype (const long &). I'm not exactly sure what that value being passed in does. Sorry.
Oct 3 '07 #3
sicarie
4,677 Expert Mod 4TB
Hi, I am new to C++ so bear with me a little bit. I am looking at a sample program for an isbn check. The first nine digits are supposed to be multiplied by a weight, added together and then divided by 11 and that should give you the 10th number or the check number.

So in the sample, the user inputs the number and it is stored in an array called isbn, the main function calls calcRemainder(bookNo). I look further down the program at the next function and it reads

long calcRemainder(char p_isbn)

What does this mean?
Interesting, we just had someone else post on that same issue, you two should get together.
Oct 3 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: dont bother | last post by:
This is really driving me crazy. I have a dictionary feature_vectors{}. I try to sort its keys using #apply sorting on feature_vectors sorted_feature_vector=feature_vectors.keys()...
3
by: SilverWolf | last post by:
I need some help with sorting and shuffling array of strings. I can't seem to get qsort working, and I don't even know how to start to shuffle the array. Here is what I have for now: #include...
7
by: Foodbank | last post by:
Hi everyone. I'm having trouble with this radix sorting program. I've gotten some of it coded except for the actual sorting :( The book I'm teaching myself with (Data Structures Using C and...
4
by: FBM | last post by:
Hi, I am working on a program that simulates one of the elements of ATM. The simulation stores events which occurs every some milliseconds for a certain amount of time. Every time that an event...
1
by: aleksander.hansen | last post by:
Hello, I have xml data that I need to group and sort. I have tried grouping it using the Muenchian Method. Probably not solved the best way, but it works. But I can't get the sorting right. ...
7
by: abracadabra | last post by:
I am reading an old book - Programming Pearls 2nd edition recently. It says, "Even though the general C++ program uses 50 times the memory and CPU time of the specialized C program, it requires...
1
by: Ahmed Yasser | last post by:
Hi all, i have a problem with the datagridview sorting, the problem is a bit complicated so i hope i can describe in the following steps: 1. i have a datagridview with two columns...
3
by: chuchi | last post by:
The following information is taken from Book Industry Study Group website : “The ISBN (International Standard Book Number) provides a standard way to identify books in global trade. On January 1,...
4
by: slapsh0t11 | last post by:
Hello! I need help with a program that I believe I am nearly done with. However, there seems to be a few details that preclude me from success. Here is my assignment: Here is my class file...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.