-
Notifications
You must be signed in to change notification settings - Fork 0
/
credit card validation system.html
42 lines (39 loc) · 1.83 KB
/
credit card validation system.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=\, initial-scale=1.0">
<title>credit card validation system</title>
<script src="credit card validation system.js"></script>
</head>
<body>
<div class="container">
<h1>Assignment 3 question 1: Credit Card Validation</h1>
<section>
<p>You're starting your own credit card business. You need to come up with a new way to validate credit cards with a simple function called <code>validateCreditCard</code> that returns <code>true</code> or <code>false</code>.
</p>
<p>Here are the rules for a valid number:
<ul>
<li>Number must be 16 digits, all of them must be numbers</li>
<li>You must have at least two different digits represented (all of the digits cannot be the same)</li>
<li>The final digit must be even</li>
<li>The sum of all the digits must be greater than 16</li>
</ul>
</p>
<p>The following credit card numbers are valid:</p>
<ul>
<li><code>9999777788880000</code></li>
<li><code>6666666666661666</code></li>
</ul>
<p>The following credit card numbers are invalid:
<ul>
<li><code>a92332119c011112</code> <em>invalid characters</em></li>
<li><code>4444444444444444</code> <em>only one type of number</em></li>
<li><code>1111111111111110</code> <em>sum less than 16</em></li>
<li><code>6666666666666661</code> <em>odd final number</em></li>
</ul>
</p>
</section>
</div>
</body>
</html>