Advertisement
Guest User

CC19 Scoring 2

a guest
Feb 27th, 2017
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. Sub Sort(ByRef myArray)
  2. Dim i, j, strHolder
  3. For i = (UBound(myArray)-1) to 0 Step -1
  4. For j = 0 to i
  5. If UCase(myArray(j)) > UCase(myArray(j+1)) Then
  6. strHolder = myArray(j+1)
  7. myArray(j+1) = myArray(j)
  8. myArray(j) = strHolder
  9. End If
  10. Next
  11. Next
  12. End Sub
  13. You = InputBox(prompt, "What is the size in bytes of your entry?")
  14.  
  15. Size = Array([All sizes of entries])
  16. Sort Size
  17. For i = LBound(Size) to UBound(Size)
  18. If Size(i) = CInt(You) then L = 45*(((i+1) * -1+UBound(Size)+1)/UBound(Size))
  19. Next
  20.  
  21. You = InputBox(prompt, "What is the speed of your entry?")
  22. Speed = Array([all speeds of entries])
  23. Sort Speed
  24. For i = LBound(Speed) to UBound(Speed)
  25. If Speed(i) = CInt(You) then P = i
  26. Next
  27.  
  28. WScript.Echo "Your score is: " & L+45*(((P+1) * -1+UBound(Speed)+1)/UBound(Speed))+InputBox(prompt, "What is your score for elegance?") & "%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement