Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Map;

public class Main {
    private static Map<String, Integer> alphaMap;

    private static int calculateSum(char[] c, byte[] weight) {
        int res = 0;
        for (int i = 0; i < c.length; i++) {
            res += (alphaMap.get(String.valueOf(c[i])) % 10) * weight[i];
        }

        res %= 11;

        return res;
    }
}