Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

VISUAL BASIC ASSIGNMENT Modify the application in Visual Studios. Modify the application to allow the user to answer the questions in any order and also

VISUAL BASIC ASSIGNMENT

Modify the application in Visual Studios.

Modify the application to allow the user to answer the questions in any order and also to change his or her answers. The modified application should display the number of incorrect answers only when the user requests the information. Make the appropriate modifications to the code.

Here what the current form looks like:

image text in transcribed

This is the code for the program that needs to be modified:

Option Explicit On Option Strict On Option Infer Off

Public Class MainForm Private Sub exitButton_Click(sender As Object, e As EventArgs) Handles exitButton.Click Me.Close() End Sub

Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'TriviaDataSet.tblGame' table. You can move, or remove it, as needed. Me.TblGameTableAdapter.Fill(Me.TriviaDataSet.tblGame)

End Sub

Private Sub newButton_Click(sender As Object, e As EventArgs) Handles newButton.Click ' starts a new game

TblGameBindingSource.MoveFirst() questionNumLabel.Text = "Question 1:" newButton.Enabled = False submitButton.Enabled = True End Sub

Private Sub submitButton_Click(sender As Object, e As EventArgs) Handles submitButton.Click ' determines whether the user's answer is correct ' and the number of incorrect answers

Dim ptrPosition As Integer Dim userAnswer As String Static numIncorrect As Integer

' store record pointer's position ptrPosition = TblGameBindingSource.Position

' determine selected radio button Select Case True Case aRadioButton.Checked userAnswer = aRadioButton.Text.Substring(1, 1) Case bRadioButton.Checked userAnswer = bRadioButton.Text.Substring(1, 1) Case cRadioButton.Checked userAnswer = cRadioButton.Text.Substring(1, 1) Case Else userAnswer = dRadioButton.Text.Substring(1, 1) End Select

' if necessary, update the number of incorrect answers If userAnswer TriviaDataSet.tblGame(ptrPosition).CorrectAnswer Then numIncorrect += 1 End If

If ptrPosition

You have to use the database engine from microsoft: https://www.microsoft.com/en-us/download/details.aspx?id=13255

The new form should look like this:

image text in transcribed

image text in transcribed

Trivia Game Question 1 Submit Answer New Game Exit Trivia Game Question: He delivered the "I have a dream" speech. Previous Question Next Question A John F. Kennedy OB Martin Luther King Jr. OC Pope John Paul l Submit Answer Change Answer Number Incorrect Exit OD The Dalai Lama tblGame Question AnswerA AnswerB AnswerC AnswerD CorrectAnswer S tblGame TableAdapter Fill,GetData

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MFDBS 89 2nd Symposium On Mathematical Fundamentals Of Database Systems Visegrad Hungary June 26 30 1989 Proceedings

Authors: Janos Demetrovics ,Bernhard Thalheim

1989th Edition

3540512519, 978-3540512516

More Books

Students also viewed these Databases questions

Question

Identify three types of physicians and their roles in health care.

Answered: 1 week ago

Question

Compare the types of managed care organizations (MCOs).

Answered: 1 week ago