------art_6828_3990668.1178131049479
Content-Type: multipart/alternative; 
	boundary---art_6829_29407486.1178131049479"

------art_6829_29407486.1178131049479
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

This is my first time submitting a solution to the quiz. I'll attach my .rb
file and copy / paste my solution below. It's ugly, but it works.

Thanks,

Chase Southard

#!/usr/bin/env ruby
#
#  Created by Chase Southard on 2007-05-01.


class CardValidator

  def get_card_number
    if $*[0] nil
      puts "I need a card number. Please enter one now:"
      cardnumber  stdin.gets.strip!
    else
      cardnumber  RGV.shift
    end
    puts "You entered: #{cardnumber}"
    @card_array  ardnumber.split(//).collect
    #remove spaces
    @card_array.compact!
  end

  def validate_card_prefix
    #case statement to grab the first few digits
    case @card_array.first.to_i
    when 3
      prefix  card_array.slice(0, 2).join.to_i
      #debug
      #puts prefix
      #puts prefix.class
      if prefix 34 || 37
        if @card_array.length 15
          card_type  AMEX"
          puts "The card type entered was: #{card_type}"
        else
          "You might have bogus card."
        end
      else
        "You might have a bogus card."
      end
    when 6
      prefix  card_array.slice(0,4).join.to_i
      #debug
      #puts prefix
      #puts prefix.class
      #puts "card length: #{@card_array.length}"
      if prefix 6011 && @card_array.length 16
          card_type  Discover"
          puts "The card type entered was: #{card_type}"
      else
        "You might have a bogus card."
      end
    when 4
      if @card_array.length 13 || 16
        card_type  Visa"
        puts "The card type entered was: #{card_type}"
      else
        "You might have a bogus card."
      end
    when 5
      prefix  card_array.slice(0, 2).join.to_i
      #puts prefix
      #puts prefix.class
      if prefix 51 || 52 || 53 || 54
        if @card_array.length 16
          card_type  MasterCard"
          puts "The card type entered was: #{card_type}"
        else
          "You might have a bogus card."
        end
      end
    end
  end

  def validate_luhn
    array_size  card_array.length

    #starting at the LAST digit and working backwards gathering digits to
get the untouched elements of the card number

    untouched_elements_index  rray.new
    while array_size > 1
      untouched_elements_index.push(array_size - 1)
      array_size - 
    end

    untouched_elements  rray.new
    untouched_elements_index.each { |e|
untouched_elements.push(@card_array[e].to_i) }


    #reset array size for the next part
    array_size  card_array.length

    #Starting at the NEXT TO LAST digit and working backwards gathering
digits to get the touched elements of the card number
    every_other_element  rray.new
    while array_size > 1
      every_other_element.push(array_size - 2)
      array_size - 
    end

    #debug
    #puts "Every other element: #{every_other_element}"

    #multiply each element by 2
    touched_array  rray.new
    every_other_element.each { |element|
touched_array.push(@card_array[element].to_i*2) }

    #debug
    #puts "Touched array: #{touched_array}"

    #split each into digits
    split_touched_array  rray.new
    touched_array.each { |e| split_touched_array.push(e.to_s.split(//)) }
    split_touched_array.flatten!

    #debug
    #puts "Split touched array:"
    #puts split_touched_array

    #return digits to integer form
    split_touched_array_integers  rray.new
    split_touched_array.each { |e| split_touched_array_integers.push(e.to_i)
}

    #debug
    #split_touched_array_total  
    #split_touched_array_integers.each { |e| split_touched_array_total + 
}
    #puts "split total  {split_touched_array_total}"


    #concatentate the two arrays
    all_digit_array  ntouched_elements + split_touched_array_integers

    #find the total value of the touched and untouched digits from the card
number
    array_total_value  
    all_digit_array.each { |x| array_total_value +  }

    #debug
    #puts "array total value  {array_total_value}"


    #final determination of validity by Luhn algorithm
    @numerical_validation  alse

    if array_total_value % 10 0
      @numerical_validation  rue
      puts "This card number, #{@card_array}, is valid [by Luhn algorithm]"
    else
      puts "This card number, #{@card_array}, is in-valid [by Luhn
algorithm]"
    end


  end


end


my_card  ardValidator.new
my_card.get_card_number
my_card.validate_card_prefix
my_card.validate_luhn

------art_6829_29407486.1178131049479
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

This is my first time submitting a solution to the quiz. I&#39;ll attach my .rb file and copy / paste my solution below. It&#39;s ugly, but it works. <br><br>Thanks,<br><br>Chase Southard<br><br>#!/usr/bin/env ruby<br>#<br>
#&nbsp; Created by Chase Southard on 2007-05-01.<br><br><br>class CardValidator<br>&nbsp; <br>&nbsp; def get_card_number<br>&nbsp;&nbsp;&nbsp; if $*[0] nil<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; puts &quot;I need a card number. Please enter one now:&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cardnumber  stdin.gets.strip!
<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cardnumber  RGV.shift<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; puts &quot;You entered: #{cardnumber}&quot;<br>&nbsp;&nbsp;&nbsp; @card_array  ardnumber.split(//).collect<br>&nbsp;&nbsp;&nbsp; #remove spaces<br>&nbsp;&nbsp;&nbsp; @card_array.compact!<br>&nbsp; end<br>&nbsp; 
<br>&nbsp; def validate_card_prefix<br>&nbsp;&nbsp;&nbsp; #case statement to grab the first few digits<br>&nbsp;&nbsp;&nbsp; case @card_array.first.to_i<br>&nbsp;&nbsp;&nbsp; when 3<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prefix  card_array.slice(0, 2).join.to_i<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #debug<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #puts prefix
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #puts prefix.class<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if prefix 34 || 37<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if @card_array.length 15<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; card_type  quot;AMEX&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; puts &quot;The card type entered was: #{card_type}&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;You might have bogus card.&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;You might have a bogus card.&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; when 6<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prefix  card_array.slice(0,4).join.to_i<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #debug
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #puts prefix<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #puts prefix.class<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #puts &quot;card length: #{@card_array.length}&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if prefix 6011 &amp;&amp; @card_array.length 16<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; card_type  quot;Discover&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; puts &quot;The card type entered was: #{card_type}&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;You might have a bogus card.&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; when 4<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if @card_array.length 13 || 16<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; card_type  quot;Visa&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; puts &quot;The card type entered was: #{card_type}&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;You might have a bogus card.&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; when 5<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prefix  card_array.slice(0, 2).join.to_i<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #puts prefix
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #puts prefix.class<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if prefix 51 || 52 || 53 || 54<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if @card_array.length 16<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; card_type  quot;MasterCard&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; puts &quot;The card type entered was: #{card_type}&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;You might have a bogus card.&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp; end<br>&nbsp; <br>&nbsp; def validate_luhn<br>&nbsp;&nbsp;&nbsp; array_size  card_array.length<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #starting at the LAST digit and working backwards gathering digits to get the untouched elements of the card number
<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; untouched_elements_index  rray.new<br>&nbsp;&nbsp;&nbsp; while array_size &gt; 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; untouched_elements_index.push(array_size - 1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array_size - <br>&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; untouched_elements  rray.new<br>
&nbsp;&nbsp;&nbsp; untouched_elements_index.each { |e| untouched_elements.push(@card_array[e].to_i) }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #reset array size for the next part<br>&nbsp;&nbsp;&nbsp; array_size  card_array.length<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #Starting at the NEXT TO LAST digit and working backwards gathering digits to get the touched elements of the card number
<br>&nbsp;&nbsp;&nbsp; every_other_element  rray.new<br>&nbsp;&nbsp;&nbsp; while array_size &gt; 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; every_other_element.push(array_size - 2)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array_size - <br>&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #debug<br>&nbsp;&nbsp;&nbsp; #puts &quot;Every other element: #{every_other_element}&quot;
<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #multiply each element by 2<br>&nbsp;&nbsp;&nbsp; touched_array  rray.new<br>&nbsp;&nbsp;&nbsp; every_other_element.each { |element| touched_array.push(@card_array[element].to_i*2) }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #debug<br>&nbsp;&nbsp;&nbsp; #puts &quot;Touched array: #{touched_array}&quot;
<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #split each into digits<br>&nbsp;&nbsp;&nbsp; split_touched_array  rray.new<br>&nbsp;&nbsp;&nbsp; touched_array.each { |e| split_touched_array.push(e.to_s.split(//)) }<br>&nbsp;&nbsp;&nbsp; split_touched_array.flatten!<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #debug<br>&nbsp;&nbsp;&nbsp; #puts &quot;Split touched array:&quot;
<br>&nbsp;&nbsp;&nbsp; #puts split_touched_array<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #return digits to integer form<br>&nbsp;&nbsp;&nbsp; split_touched_array_integers  rray.new<br>&nbsp;&nbsp;&nbsp; split_touched_array.each { |e| split_touched_array_integers.push(e.to_i) }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<br>&nbsp;&nbsp;&nbsp; #debug<br>&nbsp;&nbsp;&nbsp; #split_touched_array_total  <br>&nbsp;&nbsp;&nbsp; #split_touched_array_integers.each { |e| split_touched_array_total +  }<br>&nbsp;&nbsp;&nbsp; #puts &quot;split total  {split_touched_array_total}&quot;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; #concatentate the two arrays<br>&nbsp;&nbsp;&nbsp; all_digit_array  ntouched_elements + split_touched_array_integers<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #find the total value of the touched and untouched digits from the card number<br>&nbsp;&nbsp;&nbsp; array_total_value  
<br>&nbsp;&nbsp;&nbsp; all_digit_array.each { |x| array_total_value +  }<br><br>&nbsp;&nbsp;&nbsp; #debug<br>&nbsp;&nbsp;&nbsp; #puts &quot;array total value  {array_total_value}&quot;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #final determination of validity by Luhn algorithm<br>
&nbsp;&nbsp;&nbsp; @numerical_validation  alse<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if array_total_value % 10 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @numerical_validation  rue<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; puts &quot;This card number, #{@card_array}, is valid [by Luhn algorithm]&quot;<br>&nbsp;&nbsp;&nbsp; else<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; puts &quot;This card number, #{@card_array}, is in-valid [by Luhn algorithm]&quot;<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp; <br>&nbsp; end<br>&nbsp; <br>&nbsp; <br>end<br><br><br>my_card  ardValidator.new<br>my_card.get_card_number<br>my_card.validate_card_prefix
<br>my_card.validate_luhn<br>

------art_6829_29407486.1178131049479--

------art_6828_3990668.1178131049479
Content-Type: application/octet-stream; name=Quiz122_CardValidator.rb
Content-Transfer-Encoding: base64
X-Attachment-Id: f_f184q4qt
Content-Disposition: attachment; filename="Quiz122_CardValidator.rb"

IyEvdXNyL2Jpbi9lbnYgcnVieQojCiMgIENyZWF0ZWQgYnkgQ2hhc2UgU291dGhhcmQgb24gMjAw
Ny0wNS0wMS4KCgpjbGFzcyBDYXJkVmFsaWRhdG9yCiAgCiAgZGVmIGdldF9jYXJkX251bWJlcgog
ICAgaWYgJCpbMF0gPT0gbmlsCiAgICAgIHB1dHMgIkkgbmVlZCBhIGNhcmQgbnVtYmVyLiBQbGVh
c2UgZW50ZXIgb25lIG5vdzoiCiAgICAgIGNhcmRudW1iZXIgPSAkc3RkaW4uZ2V0cy5zdHJpcCEK
ICAgIGVsc2UKICAgICAgY2FyZG51bWJlciA9IEFSR1Yuc2hpZnQKICAgIGVuZAogICAgcHV0cyAi
WW91IGVudGVyZWQ6ICN7Y2FyZG51bWJlcn0iCiAgICBAY2FyZF9hcnJheSA9IGNhcmRudW1iZXIu
c3BsaXQoLy8pLmNvbGxlY3QKICAgICNyZW1vdmUgc3BhY2VzCiAgICBAY2FyZF9hcnJheS5jb21w
YWN0IQogIGVuZAogIAogIGRlZiB2YWxpZGF0ZV9jYXJkX3ByZWZpeAogICAgI2Nhc2Ugc3RhdGVt
ZW50IHRvIGdyYWIgdGhlIGZpcnN0IGZldyBkaWdpdHMKICAgIGNhc2UgQGNhcmRfYXJyYXkuZmly
c3QudG9faQogICAgd2hlbiAzCiAgICAgIHByZWZpeCA9IEBjYXJkX2FycmF5Ln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