Database: An Array of Structures
-
I am using VB.Net.. I have been trying this for awhile... Im making a simple console app that is a database for different video games. It will store the name, genre and a rating out of 10.. But I want it set up as several sub procedures to clean up my code. Also because I hoped it would look like an old DOS menu based system... Something like this: Games Database -------------- 1) Add a game 2) Display a games info 3) Display rating average 4) Display rating summary 5) Delete a game 6) Quit Enter a choice:_ ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
I am using VB.Net.. I have been trying this for awhile... Im making a simple console app that is a database for different video games. It will store the name, genre and a rating out of 10.. But I want it set up as several sub procedures to clean up my code. Also because I hoped it would look like an old DOS menu based system... Something like this: Games Database -------------- 1) Add a game 2) Display a games info 3) Display rating average 4) Display rating summary 5) Delete a game 6) Quit Enter a choice:_ ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
This is what i have so far..and i'm getting an error... Module Exercise4 Private Structure Game Dim name, genre As String Dim rating As Single End Structure Sub Main() Dim gameArray() As Game Dim choice, count As Integer Dim name, genre As String Dim rating As Single Call DisplayMainMenu() choice = CInt(Console.ReadLine()) If choice = 1 Then Console.Write("Enter the name of the game: ") gameArray(0).name = CStr(Console.ReadLine()) End If Console.ReadLine() End Sub Private Sub DisplayMainMenu() Console.WriteLine(" Game Database" & vbCrLf & " -------------") Console.WriteLine(vbCrLf & "1) Add a Game" & vbCrLf & "2) Display a Game") Console.WriteLine("3) Display Rating Average" & vbCrLf & "4) Display Rating Summary") Console.WriteLine("5) Quit" & vbCrLf) Console.Write("Enter a choice: ") End Sub End Module ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
This is what i have so far..and i'm getting an error... Module Exercise4 Private Structure Game Dim name, genre As String Dim rating As Single End Structure Sub Main() Dim gameArray() As Game Dim choice, count As Integer Dim name, genre As String Dim rating As Single Call DisplayMainMenu() choice = CInt(Console.ReadLine()) If choice = 1 Then Console.Write("Enter the name of the game: ") gameArray(0).name = CStr(Console.ReadLine()) End If Console.ReadLine() End Sub Private Sub DisplayMainMenu() Console.WriteLine(" Game Database" & vbCrLf & " -------------") Console.WriteLine(vbCrLf & "1) Add a Game" & vbCrLf & "2) Display a Game") Console.WriteLine("3) Display Rating Average" & vbCrLf & "4) Display Rating Summary") Console.WriteLine("5) Quit" & vbCrLf) Console.Write("Enter a choice: ") End Sub End Module ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
What's the error and where does it point to? Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
Get your facts first, and then you can distort them as much as you please Mark Twain -
What's the error and where does it point to? Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
Get your facts first, and then you can distort them as much as you please Mark Twain