5-digit Credit Card Number With Fifth Digit As Check Digit
Apr 6, 2010
I just finished this application where you enter a five-digit credit card number, with the fifth digit being the check digit. everything seems to work except, I can't seem to get it to determine that any number is "valid". Every 5-digit combination that I enter returns "The credit card number is not valid". Im using visual basic 2008 express
I need to make a app that verifies a five digit credit card number. The check digit is 5th and is found by multiplying the 2nd and 4th digit. Heres my current
Dim strInput As String Dim strOutput As String Dim intSumOfDigits As Integer
I'm supposed to write a program that validates an inputted ten digit ISBN number using the check-digit at the end to ensure that the sum is a multiple of eleven. Before calculating this and detecting if the entered number is indeed a valid ISBN, we're required to check the first nine digits and see if they are indeed integers. After this the tenth digit is checked to see if it is "X" (for ten) or 0-9.
With the code I've written it keeps returning false for whether or not the ISBN is valid, even with valid numbers. I feel like its something to do with the hyphens; have I misused the replace function?I'm a little lost on how to make my code work, but I'm fairly certain my logic is okay so far.
I got most part correctly but the only part isnt working right is when the last 5th digit match the sum number at the last number.
Private Sub btnVerify_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnVerify.Click Dim strCardNum As String Dim strSumNum As String
I'm using Visual Studio and table adapters using an Access DB as the backend. I need the minimum 4 digit value. I want to get next available 4 or 5 digit number. And this will change depending upon the users request. Currently I use a table adabpter query. But how would I write a query. I suppose I could do a long iterative loop through all values until I see a 4 digit.But I'm trying to think of something more efficient.
Function GetNextAvailableNumber(NumofDigits) as Long 'SQL Code Here ---- 'Query Number Table
I'm making a project that randomly picks a number from an array, but if it picks a number less than 10 then the number is a single instead of a double.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim N(2) As Integer N(0) = "0" & 1 N(1) = "0" & 2 N(2) = "0" & 3
i'm trying to calculate the check digit for a scan line. my problem is it needs to be weighted 2121, right to left. so what i have to do is take each character in the string and convert it to it's ASCII equivalent then multiply that by either a 2 or 1 depending on the position of the character. how can i alternate the 2 to a 1 after each character?
Dim Product As Integer Dim SumOfProducts As Integer
I am working on a check digit program and I am having some trouble finding the best path to take. The program requires 5 digits (numbers). I am calling them
num1 num2 num3 num4 num5
My ultimate goal is to use this equation:
num5 = num1 + (num2 *2) + num3 + (num4*2) - but I use the second digit of the resulting number.
Example: number 12346 - would be "correct!"
12345 - would be "wrong!"
1 + (2*2=4) + 3 + (4*2=8) = 16 so the correct would be 12346 When the user puts in the numbers on the UI I will be returning a comment in a text box on the UI.Which direction should I start?
How I could retrieve the single digits of a 4 digit number to manipulate them in my own way to encrypt the 4 digit number to my liking. Here's what I have to do; take a 4 digit number, add 7 to each digittaking the result and dividing by 10 leaving only the remainder. Then swap the first digit with the third, and swap the second with the fourth digit.
I found a good method of getting the next 4 digit number. How to find next free unique 4-digit number..But in my case I want to get next available 4 or 5 digit number.And this will change depending upon the users request. Theses number are not a key ID columns, but they are essential to the tagging structure for the business purpose. Currently I use a table adabpter query. But how would I write a query. I suppose I could do a long iterative loop through all values until I see a 4 digit.[code]Numbers is the List of All available number from 0 to 99999, basically what's available to use. LineList is my final master table where I keep the long and all the relevant other business information.
I'd like to know how to get VB to display the individual digits of a three digit number when I click a button. Sorry if this seems simple, or if it's in the wrong place.
I'm trying to calculate the ISBN check digit of a number. First I have to remove all dashes from the ISBN; the rult is a 10-digit interger. For example 0-619-15934-0 becomes 0619159340. Then apply a weight factor to each of the first nine digits and sum the weighted numbers. AThe weight factor is the digit's position in the ISBN. THat is, the first digit is multiplied by 1, the second by 2, etc. Finnally I have to compute the check digit as the mod 11 modulus of this number for example. 209 mod 11 = 0 (i.e., 209/11 = 19, remainder 0_ This is the check digit. If the remainder is 10 ten the check digit is 0. Once the check digit has been calculated, it can be compared to the check digit given with an ISBN to determine if the ISBN is correct, or appended to a new ISBN as its check digit.[code]THe first problem arises when it tells me to make sure I enter all numbers when I should be deleting the dashes and then making sure that the contents are numeric. But even without it and without entering dashes the program still blows up.
I have to do one project like : 1.Complete the code to convert a 3 digit number to Text (Number > 19) 2.Adding suitable conditional statements modify to code to support the whole range of 3 digit numbers.
I want to make a program that generates a 6 digit number for me by clicking a button. I can make a simple counter, but the nunmber I generate can only be used one. So , I need to store that number somehwere (access, xls, whatever) and then start the next count from the last number.
I want to be able to enter (type in) data into a combobox as well as picking from the list. In earlier VB there was AfterUpdate event so that I could enter in the data I wanted. Now I have tried Keypress, Enter, and others and they all want just one character or number. If I try to enter a two-digit number it doesn't wait.
Ok, now I have another problem that I cant seem to figure out I now have the "Labour charge section" just incase the service requires one. which in alot of cases it does. So, I have a test box called text box 1, which I want to be able to insert "hours worked" which is a "digit" and then Have a fixed value, of five. Which the user can later change. The number from the box, and the user specified Hourly charge, must then be multiplied to create the total labour charge which will be inserted into a label view. So, my question first, is, how would the user be able to set the hourly charge and then not be able to change it by accident. I was thinking of having a tool strip with an options tab and then setting, and then you use that to fill the info, and have that hourly charge, hidden of the actuall form so that it cant be changed by mistake. Then, on to of that, how would you multiply these two numbers?
I am trying to take a database with multiple entries of 11 digit numbers and run a check sum algorithm that adds the 12th digit to the 11 digits as an output.The algorithm is as follows:
Add sum of odd digits starting with first digit, then multiply by 3.
Add sum of even digits, then add to result of odd digits multiplied by 3.
Take result and divide by 10. The remainder is the check sum which needs to be added to the end of the original 11 digits.
I'm looking for a way to take seven 2 digit numbers & combine them into one number to store in a database.The numbers represent hours for each day of the week & I only have one field to store them in. Then I need to be able to take the stored number & decode it back into the original seven numbers. Anyone have any clever ideas how I can do this?
I am calling the function below from an Excel spreadsheet and the conversion from hex to decimal using the VAL function in the "manufacturer" variable below is coming back with a negative value. The VBA edition is 6.5.
Public Function decMEID(ByVal sKey As String) As String Dim manufacturer As String Dim serial As String