Hello I am confused on how to do this if someone can please make a code for me s
ID: 3831110 • Letter: H
Question
Hello I am confused on how to do this if someone can please make a code for me so I can just copy and paste I dont know much. Here are the requirements
Here is the code for the guess game on QB64 you will basically make the game but on visual basic GUI with the requirements above. Copy and paste the code and play the game so you understand what u need to write please no bad codes I need to understand it all.
READ CAREFULLY You will create a Visual Basic version of the guess the number game that is written in QB64. Play the QB64 version to understand the parts of the game Design a window for the game. Items: Include a splash screen Include a second form as a help screen Return to main form when help screen is closed For play again, be sure to reset variables and objects for the game. The colors for objects will be your choice. Object behavior will be your choiceExplanation / Answer
here i write first code :
DIM Answer AS INTEGER
DIM Guess AS INTEGER
DIM Cnt AS INTEGER
DIM Game AS STRING
CLS
DO
PRINT "Guess My Number Game:"
PRINT " A) 10 "
PRINT " B) 100 "
PRINT " C) 1000 "
INPUT "PLEASE ENTER A GAME:", Game
Game=UCASE$(Game)
LOOP UNTIL Game = "A" OR Game = "B" OR Game = "C"
CLS
RANDOMIZE TIMER
SELECT CASE Game
CASE "A"
ANSWER = (RND * 9) + 1
PRINT "Game 1 - 10 "
CASE "B"
ANSWER = (RND * 99) + 1
PRINT "Game 1 - 100 "
CASE "C"
ANSWER = (RND * 999) + 1
PRINT "Game 1 - 1000 "
END SELECT
Guess= 0
Cnt= 0
DO
INPUT " PLEASE ENTER A GUESS:", Guess
Cnt= Cnt + 1
IF Guess< Answer THEN
PRINT ""Too Low"
ELSEIF Guess> Answer THEN
PRINT ""Too High"
ELSE
PRINT "You Guessed My Number In:"; Cnt; "Tries"
END IF
LOOP UNTIL Guess=Answer
DO
INPUT "Play Again Y/N:", Game
Game=UCASE$(Game)
LOOP UNTIL Game = "Y" OR Game = "N"
LOOP UNTIL Game = "N"
END SUB
//Second code:
Public Class Guess
Dim Counter As Integer
Dim CG As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button1.Click
Dim Number As New Random
CG = Number.Next(10) + 1
Counter = 0
TextBox1.Text = ("")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button2.Click
Dim R As DialogResult
R = MessageBox.Show("Are you sure you want to quit?", "Game Quit", MessageBoxButtons.YesNo)
If R = Windows.Forms.DialogResult.No Then
Button1.PerformClick()
ElseIf R = Windows.Forms.DialogResult.Yes Then
Me.Close()
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button3.Click
Dim UG As Integer
UG = CInt(TextBox1.Text)
Counter = Counter + 1
Try
If UG = CG Then
MessageBox.Show("You guessed my Number!")
ElseIf UG < CG Then
MessageBox.Show("Your guess is too low")
ElseIf UG > CG Then
MessageBox.Show("Your guess is too high.")
End If
Catch E1 As InvalidCastException
MessageBox.Show("Please enter a number and try agian")
End Try
End Sub
End Class
Public Class Guess
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.