Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static int getCost(String uniqID) {

        // Currently hard coding the cost value : // TODO: has to be removed
        int hashCode = uniqID.hashCode();
        if (hashCode < 0)
            hashCode = hashCode * -1;
        int cost = hashCode % 40 + 10;
        if (cost % 6 == 0 || cost % 8 == 0) {
            cost = 0;
        }
        return cost;
    }
}