我需要实现加权模数11公式,请帮助我 [英] i need to implement weighted modulus 11 formula plz help me
问题描述
问题:
加权模数11公式
格式为
加权因子为86423597
获得这些数字的总和
除以11
如果rem为0,则将5用作校验位;如果rem为1,则将0用作校验位
例如:
数字4 7 3 1 2 4 8 2
加权系数* 8 * 6 * 4 * 2 * 3 * 5 * 9 * 7
-------------------------
32 + 42 + 12 + 2+ 6 + 20 + 72 + 14 = 200
200:11 = 18余数2
11-2 = 9个校验位
完整的自检号码:473124829
我需要此方法的ac#代码.
私有 enabledToProgram As 布尔值 = 错误 私有 子 Button1_Click( ByVal 发件人 As 系统.对象,_ ByVal e As System.EventArgs)_ 句柄 Button1.点击 Dim 等级 As 字符串 Dim 决定 As String 同时 不能 决定= InputBox(" ,_ " ," Y") 如果决策.ToUpper= " 然后 等级= PostAssignmentOnForums() 其他 等级= DoWorkYourself() 结束 如果 MsgBox(字符串 .Format(" ,成绩)) 结束 同时 MsgBox(" ) 结束 子 函数 PostAssignmentOnForums() As 字符串 ableToProgram = 错误 返回 " 结束 功能 功能 DoWorkYourself() As 字符串 ableToProgram = 正确 返回 " 结束 功能
如何完成编程作业分配 [ ^ ]
Question :
weighted Modulus 11 Formula
The format is
Weighted factors are 86423597
obtain sum of these numbers
divide by 11
if rem is 0 use 5 as the check digit.if remainder is 1 use 0 as the check digit
example:
Number 4 7 3 1 2 4 8 2
Weighting facotrs *8 *6 *4 *2 *3 *5 *9 *7
-------------------------
32+42+12+ 2+ 6+20+ 72+14=200
200:11 = 18 remainder 2
11-2 =9 checkdigit
complete self checking number:473124829
I need a c# code for this Method
Private ableToProgram As Boolean = False Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Dim grade As String Dim decision As String While Not ableToProgram decision = InputBox("Do you want to cheat? (Y/N)", _ "Learn to Program", "Y") If decision.ToUpper = "Y" Then grade = PostAssignmentOnForums() Else grade = DoWorkYourself() End If MsgBox(String.Format("You got an {0}", grade)) End While MsgBox("Good Choice!") End Sub Function PostAssignmentOnForums() As String ableToProgram = False Return "F" End Function Function DoWorkYourself() As String ableToProgram = True Return "A" End Function
这篇关于我需要实现加权模数11公式,请帮助我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!