ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  VB.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
if user enters 1 or 2 or any other number in digit format in
next textbox it should show the answer in word reading
like if enters 12 answer should be twelve
 Question Submitted By :: Shweta
I also faced this Question!!     Rank Answer Posted By  
 
  Re: if user enters 1 or 2 or any other number in digit format in next textbox it should show the answer in word reading like if enters 12 answer should be twelve
Answer
# 1
I tried lot but not able to do it.
 
Is This Answer Correct ?    0 Yes 0 No
Vijay
 
  Re: if user enters 1 or 2 or any other number in digit format in next textbox it should show the answer in word reading like if enters 12 answer should be twelve
Answer
# 2
Here is a Program, which can perform upto 99,999 ...
Note: in a vb.net form you have to place one text box named
as  txt1 and one label named as Lab1....
Private Sub txt1_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles txt1.TextChanged
        Try
            If Val(txt1.Text) <> 0 Then
                fun(txt1.Text)
            Else
                Lab1.Text = ""
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
    Public Function fun(ByVal t As Integer)
        Dim l As Int16
        l = Len(CStr(t))
        Select Case l
            Case 1
                Lab1.Text = Ones(t)
            Case 2
                Lab1.Text = Case2(t)
            Case 3
                Lab1.Text = Case3(t)
            Case 4
                Lab1.Text = Case4(t)
            Case 5
                Lab1.Text = Case5(t)
        End Select
        fun = Lab1.Text
    End Function
    Public Function Case5(ByVal t As Integer) As String
        Dim L2 As String
        Dim R3 As String
        L2 = Strings.Left(CStr(t), 2)
        R3 = Strings.Right(CStr(t), 3)
        If CInt(R3) = 0 Then
            Case5 = Case2(CInt(L2)) & " Thousand "
        Else
            Case5 = Case2(CInt(L2)) & " Thousand "
            If Strings.Left(R3, 1) = "0" Then
                Case5 = Case5 & " and " & Case2(CInt(R3))
            Else
                Case5 = Case5 & Case3(CInt(R3))
            End If
        End If
    End Function
    Public Function Case2(ByVal t As Integer) As String
        Dim q, r As Int16
        If t > 10 And t < 20 Then
            Case2 = Teens(t)
        Else
            q = Int(t / 10)
            r = t Mod 10
            Case2 = Tens(q) & " " & Ones(r)
        End If
    End Function
    Public Function Case3(ByVal t As Integer) As String
        Dim q1, q2, q, r As Integer
        Dim LabTxt As String
        q1 = Int(t / 100)
        If (t - (q1 * 100)) = 0 Then
            LabTxt = Ones(q1) & " Hundred "
        Else
            LabTxt = Ones(q1) & " Hundred and "
        End If
        q2 = t - (q1 * 100)
        If q2 > 10 And q2 < 20 Then
            Case3 = LabTxt & Teens(q2)
        Else
            q = Int(q2 / 10)
            r = q2 Mod 10
            Case3 = LabTxt & Tens(q) & " " & Ones(r)
        End If
    End Function

    Public Function Case4(ByVal t As Integer) As String
        Dim q As Int16
        Dim r As Int16
        Dim q1 As Int16
        Dim q2 As Int16
        Dim LabTxt As String
        Dim q4 As Integer
        q4 = Int(t / 1000)
        LabTxt = Ones(q4) & " Thousand "
        t = t - q4 * 1000
        If t = 0 Then
            Case4 = LabTxt
            Exit Function
        End If
        q1 = Int(t / 100)
        If q1 = 0 Then
            LabTxt = LabTxt & " and "
            If t > 10 And t < 20 Then
                Case4 = LabTxt & Teens(t)
            Else
                q = Int(t / 10)
                r = t Mod 10
                Case4 = LabTxt & Tens(q) & " " & Ones(r)
            End If
            Exit Function
        End If
        If (t - (q1 * 100)) = 0 Then
            LabTxt = LabTxt & Ones(q1) & " Hundred "
        Else
            LabTxt = LabTxt & Ones(q1) & " Hundred and "
        End If
        q2 = t - (q1 * 100)
        If q2 > 10 And q2 < 20 Then
            Case4 = LabTxt & Teens(q2)
        Else
            q = Int(q2 / 10)
            r = q2 Mod 10
            Case4 = LabTxt & Tens(q) & " " & Ones(r)
        End If
    End Function
    Public Function Ones(ByVal t As Integer) As String
        Ones = ""
        Select Case t
            Case 1
                Return "One"
            Case 2
                Return "Two"
            Case 3
                Return "Three"
            Case 4
                Return "Four"
            Case 5
                Return "Five"
            Case 6
                Return "Six"
            Case 7
                Return "Seven"
            Case 8
                Return "Eight"
            Case 9
                Return "Nine"
        End Select
    End Function
    Public Function Tens(ByVal Que As Int16) As String
        Select Case Que
            Case 1
                Return "Ten"
            Case 2
                Return "Twenty"
            Case 3
                Return "Thirty"
            Case 4
                Return "Forty"
            Case 5
                Return "Fifty"
            Case 6
                Return "Sixty"
            Case 7
                Return "Seventy"
            Case 8
                Return "Eighty"
            Case 9
                Return "Ninty"
        End Select
    End Function

    Public Function Teens(ByVal Que As Int16) As String
        Select Case Que
            Case 11
                Return "Eleven"
            Case 12
                Return "Twelve"
            Case 13
                Return "Thirteen"
            Case 14
                Return "Forteen"
            Case 15
                Return "Fifteen"
            Case 16
                Return "Sixteen"
            Case 17
                Return "Seventeen"
            Case 18
                Return "Eighteen"
            Case 19
                Return "Ninteen"
        End Select
    End Function
 
Is This Answer Correct ?    1 Yes 0 No
Cherran
 
 
 
  Re: if user enters 1 or 2 or any other number in digit format in next textbox it should show the answer in word reading like if enters 12 answer should be twelve
Answer
# 3
Private Sub Button1_Click(ByVal sender As System.Object, 
ByVal e As System.EventArgs) Handles Button1.Click
        Me.TextBox3.Text = CInt(Me.TextBox1.Text) + CInt
(Me.TextBox2.Text)
    End Sub
 
Is This Answer Correct ?    1 Yes 1 No
Sonia
 
  Re: if user enters 1 or 2 or any other number in digit format in next textbox it should show the answer in word reading like if enters 12 answer should be twelve
Answer
# 4
Answer 3 is wrong
 
Is This Answer Correct ?    0 Yes 0 No
Anil
 

 
 
 
Other VB.NET Interview Questions
 
  Question Asked @ Answers
 
What is CLR?  11
hello! I am developing software in vb6 and vb.net separately which i need to generate barcodes e.g i have a string "182346-u",so the problem is that how to generate barcode from this type of string can any body help me please thanks regard !  2
if user enters 1 or 2 or any other number in digit format in next textbox it should show the answer in word reading like if enters 12 answer should be twelve  4
Why Datareader is useful?  5
how to call a list box on the text if some one send me the code for it  1
What are the similarities between class and structure? Ksb5
when we will use console ?  3
sir how i can calculate the value of two-textbox of gridview and show result in textbox within gridview in asp.net with vb.net..plz sir reply me Biz-Technology1
How does you call and execute a SP in .NET?  2
There are three versions of VB6--Learning Edition, Professional and Enterprise. Is VB.Net similar?  1
Is there any easy way to convert VB6 programs to VB.Net?  3
how to connect crystal report with vb.net ? Patni6
I want to reduce my CPU Usage when I am querying the Database for records. Now my Winform App(in VB.Net) suddenly Jumps to 100% CPU Usage when i query for records from sql server database. I want this Usage to be less. Any help is appreciated  2
What is the difference b/w Readonly Variable and Constant Variable? Sonata5
What are the objects in asp.net and tell the purpose of those objects Ascent2
concept of object oriented programming Patni5
What is an indexed property?  1
Advantage of vb.net over vb ? Digital-GlobalSoft5
How to create Crystal Report in vb.net with coding Ascent1
What is the Common Language Runtime? Ksb8
 
For more VB.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com