Context:
The company that you work for suspects that credit card distributors have
been mailing out cards that have invalid numbers.
In this project, you have the role of a clerk who checks if credit
cards are valid.
It is NOT real life C/Card checking routine - although I did
download a copy of a LUHN ALGORITHM which is, apparently, a legit
way of checking if a card number is valid (maybe?).
So I did the following to satisfy the lesson directives...
I needed to check that...
if the 1st digit of the card is, then assume it is from...
3 = Amex
4 = Visa
5 = Mastercard
6 = Discover
0 = Any other company - 'message Company Not Found'
In the returned answer (in RED) on the
previous pane you should see 6 digits
the 1st number is how many invalid company cards were found
the 3rd number is how many invalid Amex cards were found
the 4th number is how many invalid Visa cards were found
etc...
and that is all I needed to do.
DNA - Project Goals
Context: You’re part of a research team that has found a new mysterious
organism at the bottom of the ocean near hydrothermal vents.
Your team names the organism, Pila aequor (P. aequor), and finds that it is
only comprised of 15 DNA bases.
The small DNA samples and frequency at which it mutates due to the
hydrothermal vents make P. aequor an interesting specimen to study.
However, P. aequor cannot survive above sea level and locating
P. aequor in the deep sea is difficult and expensive.
Your job is to create objects that simulate the DNA
of P. aequor for your research team to study.
Basically though it does do what they wanted but I have
included all the code in the <script> section so you can take a look
to remind you of what/how you do.
So see the code for the example(s)
But the below shows the result of 'animal1.mutate()'
(Original DNA value was...)