|
-
Nov 15th, 2019, 09:31 PM
#1
Thread Starter
New Member
Functions and Procedures
I'm a student currently learning VB.Net. Our professor has a lab assignment where he wants us to create functions that we pass into a procedure. I'm not really getting a grasp on the assignment. There's five tasks he wants us to complete.
First, he wants us to ask the user for a string, determine if the string length is between 26 and 32. That part I got figured out.
The next part of that task is he wants us to find out the length of the string without using built-in functions like .Length or .GetLength. He gave a hint about passing it into a charArray.
Second, He wants us to carry the string to another function that checks if the string contains at least one of each Vowel. Give a Boolean True or False
Third, He wants us to carry the sting to another function that checks if every letter of the alphabet is used in the string. Give a Boolean True or False
Fourth, He wants us to carry the string to another function that checks if there are any special characters in the string. Give a Boolean True or False
Lastly, he wants us to pass the string to a procedure he listed as
ComboCheck ( ByVal stringName as String, ByRef VowelCheck as Byte, ByRef PangramCheck as Byte, PasswordCheck as Byte )
You can call the functions you wrote in Task 2, Task3 and Task4 from ComboCheck. The booleans returned from those functions can be returned via ByRef in Task 5.
I just need to be pointed in the right direction. I know I'm doing something wrong creating these functions and trying to connect to the inputted string. I just don't know what it is. If someone could give me a hint or point me in the right direction it'd be really helpful. My code so far is as follows:
Module Module1
Sub StringName(ByRef input As String)
Dim charArray() As Char = {input}
Dim counter As Integer = 0
For Each element In charArray
counter += 1
Next
Console.WriteLine("String length is: " & counter)
End Sub
Sub IsItVowelGram(ByRef StringName As String)
End Sub
Sub Pangram(ByRef StringName As String)
End Sub
Sub PassWordCheck(ByRef StringName As String)
End Sub
Sub Main()
Dim input As String
Console.WriteLine("Please Enter a String")
input = Console.ReadLine()
If input.Length >= 26 And input.Length <= 32 Then
Console.WriteLine("Correct input of String")
Else
Do
Console.WriteLine("Please enter a string")
input = Console.ReadLine()
Loop Until input.Length >= 26 And input.Length <= 32
End If
End Sub
Sub ComboCheck(ByRef StringName As String, ByRef VowelCheck As Byte, ByRef PangramCheck As Byte, PasswordCheck As Byte)
End Sub
End Module
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|