Completed Projects
  • - 2006 -
  • Lambs in Ascension
  • NamJune();Paik()
  • Myspaces
  • Net.Art.06


  • - Pre -
  • Flight 175
  • American Internet
  • Protest Pieces, 1-5
  • Dancing Pixels
  • ASCII Nudes
  • Edie Sedgewick
  • Auction Stand...
  • Animation Festivale!


  •  Archives
  • January 2006
  • February 2006
  • March 2006
  • April 2006
  • June 2006
  •  Links
    My Alleged Atom Feed
    RSS Jockey
    My del.icio.us
    Turbulence
    DVBlog
    Radio Open Source
    PetitMorte
    Newsgrist
    MTAA
    My DD
    Eyebeam
    Rhizome
    WM$NA
    UMaine NMD
    Thing/Node
    digital souls

    Monday, February 27, 2006
     Inappropriate Software Problems and Their Solutions in Visual Basic
    Had a dream, woke up, typed this to mr.kalx.com, decided to share it here.

    Q. "Every time Clarissa sees a butterfly, she gets slapped once, plus slapped again for every butterfly she has seen before. She is reduced one half slap for every stolen jelly. Design a program that will express this."

    A:

    Private Sub btnSlaps_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSlaps.Click
    Dim butterfly As Integer
    Dim slaps As Double
    Dim jellies As Integer
    Dim jellyslap As Double

    butterfly = CInt(txtButterflies.Text)
    jellies = CDbl(txtJellies.Text)
    jellyslap = jellies * 0.5
    slaps = (butterfly + 1) - jellyslap

    MsgBox("Clarissa should be slapped " & FormatNumber(slaps, 2) & " times for seeing " & butterfly & " butterflies if she has stolen " & jellies & " jellies.", , "")

    Posted by Eryk @ 8:17 PM

    Comments: Post a Comment