Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
program generated by chatgpt
#1
this program was generated by chat gpt. I did have to lightly edit it because it tried to use the symbol "&" in place of the symbol ";" in print commands, otherwise it all came from this prompt:

create qb64pe source code that allows the user to select from a displayed list of 10 entries.

Code: (Select All)
' Define an array to hold the list of entries
Dim entries(10) As String

' Populate the array with sample data
entries(1) = "Apple"
entries(2) = "Banana"
entries(3) = "Cherry"
entries(4) = "Date"
entries(5) = "Eggplant"
entries(6) = "Fig"
entries(7) = "Grape"
entries(8) = "Honeydew"
entries(9) = "Kiwi"
entries(10) = "Lemon"

' Display the list of entries
Print "Please select an entry from the list:"
For i = 1 To 10
    Print i; ") "; entries(i)
Next i

' Get the user's selection
Do
    Input "Enter your selection: ", selection
    If selection < 1 Or selection > 10 Then
        Print "Invalid selection. Please try again."
    Else
        Exit Do
    End If
Loop

' Display the selected entry
Print "You selected: "; entries(selection)
Reply


Messages In This Thread
program generated by chatgpt - by James D Jarvis - 12-16-2022, 07:06 PM
RE: program generated by chatgpt - by madscijr - 12-16-2022, 08:51 PM
RE: program generated by chatgpt - by madscijr - 12-16-2022, 09:40 PM
RE: program generated by chatgpt - by Pete - 12-16-2022, 07:15 PM
RE: program generated by chatgpt - by mnrvovrfc - 12-16-2022, 10:24 PM
RE: program generated by chatgpt - by mnrvovrfc - 12-17-2022, 04:39 PM
RE: program generated by chatgpt - by Pete - 12-16-2022, 07:38 PM
RE: program generated by chatgpt - by Pete - 12-16-2022, 08:05 PM
RE: program generated by chatgpt - by madscijr - 12-16-2022, 09:44 PM
RE: program generated by chatgpt - by mnrvovrfc - 12-16-2022, 10:46 PM
RE: program generated by chatgpt - by mnrvovrfc - 12-22-2022, 04:52 PM



Users browsing this thread: 3 Guest(s)