Problem Set 10: Credit Card

Web-CAT: Submit Java programs to this automated grading platform.

Task Outline

Background Theory

Example Case

3\underline{7}8\underline{2}8\underline{2}2\underline{4}6\underline{3}1\underline{0}0\underline{0}5
\textbf{7}\cdot{2} + \textbf{2}\cdot{2} + \textbf{2}\cdot{2} + \textbf{4}\cdot{2} + \textbf{3}\cdot{2} + \textbf{0}\cdot{2} + \textbf{0}\cdot{2}
14 + 4 + 4 + 8 + 6 + 0 + 0
1 + 4 + 4 + 4 + 8 + 6 + 0 + 0 = 27
27 + 3 + 8 + 8 + 2 + 6 + 1 + 0 + 5 = 60

Hints

String sample = "123";
int num = Integer.parseInt(sample);
3\underline{7}8\underline{2}8\underline{2}2\underline{4}6\underline{3}1\underline{0}0\underline{0}5
\underline{5}1\underline{0}5\underline{1}0\underline{5}1\underline{0}5\underline{1}0\underline{5}1\underline{0}0

Code Distribution

Description File Size File Name
Java Source Code for Credit Card 5.3KB pset10.zip

Contents of pset10.zip:

PSet10CreditCard/
├── CreditCard.class
├── CreditCard.ctxt
├── CreditCard.java
├── CreditCardJUnitTest.class
├── CreditCardJUnitTest.ctxt
├── CreditCardJUnitTest.java
├── package.bluej
└── README.TXT

Specification

Testing

Submission