Je doit faire un petit programme en Visual Basic et j'ai vraiment de la difficuleté. Voici le problème:
Write a program... that inputs lines of text and uses function InStr to determine the total number of occurences of each letter of the alphabet in the text. Uppercase (Majuscule) and lowercase (Minuscule) should be countered together. Store the totals for each letter in an array (Tableau), and display the values in tabular format after the totals have been deternined.
Sortie: Les statistiques provenant du tableau sont imprimées sur papier (Imprimante).
Voici le code que j'ai présentement:
Option Explicit
Dim mNbreLettreRetrouve(25) As Long
Dim mLettreRecherche(25) As String
Private Sub cmdQuitter_Click()
End
End Sub
Private Sub cmdRecherche_Click()
Dim intCompteur As Integer
Dim intIndice As Integer
Dim intRecherche As Integer
Dim intDebutRecherche As Integer
Dim strLettreRecherche As String
Dim intNombreRecherche As Integer
intDebutRecherche = 1
For intNombreRecherche = 0 To 25
Do Until intIndice = Len(txtTexte.Text)
intRecherche = InStr(intDebutRecherche, txtTexte.Text, mLettreRecherche(intNombreRecherche), vbTextCompare)
If intRecherche <> 0 Then
intDebutRecherche = intRecherche + 1
intCompteur = intCompteur + 1
End If
intIndice = intIndice + 1
Loop
mNbreLettreRetrouve(intIndice - 1) = intCompteur
Next intNombreRecherche
End Sub
Private Sub Form_Load()
mLettreRecherche(0) = "A"
mLettreRecherche(1) = "B"
mLettreRecherche(2) = "C"
mLettreRecherche(3) = "D"
mLettreRecherche(4) = "E"
mLettreRecherche(5) = "F"
mLettreRecherche(6) = "G"
mLettreRecherche(7) = "H"
mLettreRecherche(8) = "I"
mLettreRecherche(9) = "J"
mLettreRecherche(10) = "K"
mLettreRecherche(11) = "L"
mLettreRecherche(12) = "M"
mLettreRecherche(13) = "N"
mLettreRecherche(14) = "O"
mLettreRecherche(15) = "P"
mLettreRecherche(16) = "Q"
mLettreRecherche(17) = "R"
mLettreRecherche(18) = "S"
mLettreRecherche(19) = "T"
mLettreRecherche(20) = "U"
mLettreRecherche(21) = "V"
mLettreRecherche(22) = "W"
mLettreRecherche(23) = "X"
mLettreRecherche(24) = "Y"
mLettreRecherche(25) = "Z"
End Sub
Private Sub txtTexte_Change()
If Not txtTexte.Text = "" Then
cmdRecherche.Enabled = True
End If
End Sub
Que dois-je faire pour répondre aux exigences???
Merci d'Avance!!!