Sinisterly
[VB.Net] Programming exercises - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework)
+--- Thread: [VB.Net] Programming exercises (/Thread-VB-Net-Programming-exercises)

Pages: 1 2 3 4


RE: [VB.Net] Optimization Challenge - Coder-san - 05-22-2011

(05-22-2011, 12:06 PM)1234hotmaster Wrote:
Code:
Module Module1 Sub Main() Dim str As String = Console.ReadLine() Console.WriteLine(StrConv(str, VbStrConv.ProperCase)) End Sub End Module

Now that you've got your "solvable" challenge, moving on to the regular ones. Biggrin

Challenge #4


Write a program which will make every first character of a word lowercase, and the rest uppercase.

E.g.
Code:
tHE qUICK bROWN fOX jUMPS oVER tHE lAZY dOG.



RE: [VB.Net] Optimization Challenge - 1234hotmaster - 05-22-2011

Code:
Module Module1 Sub Main() Dim str As String = Console.ReadLine Dim P As String : Dim b As Byte For Each s As String In Split(str, Space(1)) P &= s.Substring(0, 1).ToLower & s.Replace(s.Substring(0, 1), String.Empty).ToString.ToUpper & Space(1) b += 1 Next MsgBox(P) End Sub End Module



RE: [VB.Net] Optimization Challenge - Coder-san - 05-22-2011

Close, but buggy. Good try. Smile

If an alphabet comes twice in a word it is ignored by your code.

[Image: fdP5K.png]


RE: [VB.Net] Optimization Challenge - 1234hotmaster - 05-23-2011

can i post the working one or its against the rules? Biggrin


RE: [VB.Net] Optimization Challenge - Coder-san - 05-23-2011

ok, I can allow staff to double-post. Because staff can't win competitions. :p


RE: [VB.Net] Optimization Challenge - 1234hotmaster - 05-23-2011

Code:
Module Module1 Sub Main() Dim str As String = Console.ReadLine Dim P As String For Each s As String In Split(str, Space(1)) P &= s.Substring(0, 1).ToLower & s.Remove(0, 1).ToUpper & Space(1) Next MsgBox(P) End Sub End Module



RE: [VB.Net] Optimization Challenge - Coder-san - 05-23-2011

Ok this one works perfectly. Good job. Smile


RE: [VB.Net] Programming exercises - Johnrivera - 05-26-2011

Visual Basic is the third-generation programming language from Microsoft. visual basic is very user friendly that's why Visual Basic is easy to learn and use.scripting languages are similar to visual basic but platform is different ,vb.net is one of the best language to develop a software.



RE: [VB.Net] Programming exercises - 1234hotmaster - 05-26-2011

(05-26-2011, 08:58 AM)Johnrivera Wrote: Visual Basic is the third-generation programming language from Microsoft. visual basic is very user friendly that's why Visual Basic is easy to learn and use.scripting languages are similar to visual basic but platform is different ,vb.net is one of the best language to develop a software.

so what does this have to do with the topic? ^_^'

PS: coder post next one im thirsty! Biggrin


RE: [VB.Net] Programming exercises - EricTheGrey - 03-10-2013

This thread seems old. Can you make a new contest?