By using this site, you agree to our Privacy Policy and our Terms of Use. Close
superchunk said:
1. Update your drivers
2. Retest

if (broken) {
buyNew();
}
else {
beHappy();
}

I wanna pad this out a bit more:

 Module DiscTray

public currentFunds as double
public trayPrice as double = 25

     Sub Main()
       dim broken as boolean

       'someone else can write test code.

       console.writeline("What are you current funds?")
       currentFunds = console.readline()

       if (broken = True) then
              buyNew()
       else
              beHappy()
       endif

       console.readline()

     End Sub

     sub buyNew()
         dim action as string = "Purchase"
         dim mood as string = "pissed"
         dim wallet as integer = currentFunds - trayPrice

     console.writeline("You need to buy new drive. Remaining funds: " & wallet)

     if (wallet > 0) then
          console.writeline(mood)
     else
          console.writeline(mood & mood)
     endif

     End Sub

     sub beHappy()
          dim hormone as string
          hormone = "endorphins"

          console.writeline("Releasing " & hormone)

    end sub