fork download
  1. Module VBModule
  2.  
  3. Sub Main()
  4. Dim pyg As String = "ay" 'Defining Pig Latin variable
  5. console.writeline("Enter string to be translated: ")
  6. Dim str As String = console.read() 'Defining string to be modified
  7. Dim stri As String ' Declaring variable for lower-case string
  8. Dim first As Char 'Declaring First character variable
  9. Dim neword As String 'Declaring new word variable
  10. If len(str) > 0 Then 'If string is genuine
  11. stri = str.ToLower() 'String is converted to lower case
  12. first = stri.Substring(0,1) 'Getting first character of string
  13. If first = "a" or first = "e" or first = "i" or first = "o" or first = "u" Then 'If letter begins with vowel
  14. neword = stri+pyg 'Concatinating strings
  15. console.writeline(neword) 'Writing output
  16. Else
  17. neword = stri.Substring(1)+stri.substring(0,1)+pyg 'Concatinating strings
  18. console.writeline(neword) 'Outputting value
  19. End If
  20. End If
  21. End Sub
  22. End Module
Success #stdin #stdout 0.09s 25680KB
stdin
Testing
stdout
Enter string to be translated: 
48ay