Hi, im currently working on a project to create a menu driven program only using coding in visual basic console application. I'm stuck on creating the quadratic solver as im unsure on how to start.
Im stuck on the quadratic equation part, any help will be appreciated thank you
What I have tried:
Module Module1
Sub Main()
Dim Choice As String
' Keep asking until the user enters one of the following options. (Data Validation).
Do
' Prompt...
Console.WriteLine("CS0002")
Console.WriteLine("********************************************************************")
Console.WriteLine("Main Menu")
Console.WriteLine("1.Accuracy Decision")
Console.WriteLine("2.Quadratic equation")
Console.WriteLine("3.Monte-Carlo Integration")
Console.WriteLine("4.Prime number decider")
Console.WriteLine("5.Exit" & vbNewLine)
Console.WriteLine("Please select an option from 1-5:")
' Menu is created by console.writeline statements'
' Read a key. ReadKey returns a ConsoleKeyInfo value.
Dim key As ConsoleKeyInfo = Console.ReadKey
' ConsoleKeyInfo contains information about the key pressed.
' KeyChar gets the character for the key pressed.
' If the user pressed 1-5 then they proceed to the next step
' value to usersChoice...
Select Case key.KeyChar
Case "1"
Call Accuracy()
Case "2"
Call quadratic()
Case "3"
Call Monte()
Case "4"
Call Prime()
Case "5"
Exit Do
End Select
Console.WriteLine()
Console.WriteLine("Press any key to return to the menu...")
Choice = Console.ReadKey(True).KeyChar()
Loop
End Sub
Sub Accuracy()
Console.WriteLine("Feauture not implemented")
End Sub
Sub quadratic()
Dim a, b, c, det As Integer
Dim root1, root2 As Single
Dim numroot As Integer