Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In Visual Basic 2015 Write a program that asks a quiz show contestant to select

ID: 3683338 • Letter: I

Question

In Visual Basic 2015 Write a program that asks a quiz show contestant to select one of the numbers 1, 2, or 3 and then calls a Sub procedure that asks the question having that number and requests the answer. The Sub procedure should then call another Sub procedure to tell the contestant if the answer is correct. Use the following three questions: 1. Who was the only living artist to have his work displayed in the Grand Gallery of the Louvre? 2. Who said, "Computers are useless. They can only give you answers."? 3. By what name is Pablo Blasio better known? Note: These questions have the same answer, Pablo Picasso.

Explanation / Answer

Public Class frmQuizContest
Private Sub btnGo_Click ( ByVal sender As System.Object ,ByVal e As System.EventArgs )Handles btnGo.Click
Dim option As Integer =CInt ( txtNum.Text )
Dim query As String =""
Dim rightChoice As String =""
Dim participantChoice As String =""
BeginCompetition ( option ,query ,rightChoice ,participantChoice )
ShowOutcomes ( participantChoice ,rightChoice )
End Sub
Sub BeginCompetition ( ByVal queryNum As Integer ,ByVal query As String ,ByRef rightChoice As String ,ByRef participantChoice As String )
'a Sub procedure that asks the query having that number and requests the answer

Select Case queryNum
Case "1"
query =" Who was the only living artist to have his workd displayed in the Grand Gallery of the Louvre ? "
rightChoice =" pablo picasso "
Case "2"
query =" Who said ,' Computers are uselss. They can only give you answers ' ? "
rightChoice =" pablo picasso "
Case "3"
query =" By what name is Pablo Blasio better known ? "
rightChoice =" pablo picasso "
Case Else
End Select
participantChoice =InputBox ( query ,participantChoice )
End Sub

Sub ShowOutcomes ( ByRef rightCho As String ,ByRef participantCho As String )
'Sub procedure to tell the contestant if the answer is correct.
Dim prompt As String =" Correct! "
Dim title As String =" Result. "
Dim prompt1, title1 As String
prompt1 =" Sorry, Try again! "
title1 =" Result "
If participantCho =rightCho Then
MessageBox.Show ( prompt ,title )
Else
MessageBox.Show ( prompt1 ,title1 )
End If
End Sub
End Class

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote