College Class - Project Help!! HELP?

ksgush

New member
Joined
Oct 17, 2005
Messages
2
Programming Experience
Beginner
I am a college student and I am doing this project in vb.net for class and it's due almost asap.

Here is the assignment.



Introduction to Programming for IT

Project 3

Math Test Program


The math department has asked you to create a program that can create random math problems, to test student abilities. This program should create 10 random math addition, subtraction, or multiplication problems (no division), displaying each problem on the screen. (Note: Do NOT show the answer!) Use only integers. You can use radio buttons to select which kind of problems are to be done. The program should have a button to create a test (10 new problems), another button to accept and check the student's answers, and a button to quit the program.

When the "Create a new problem" button is pressed, the program should create the new math problems by generating random numbers between 0 and 50. To do this you will need to use a random number generator. Use the following to create random numbers:



Dim rndGenerator As New Random
intNum = rndGenerator.Next(0,51)

This creates a Random Object named rndGenerator. Then the Random Object is used to assign a random number to the intNum variable. The random number will be greater than or equal to 0 but less that 51 in this case. How can you modify this code to supply random numbers in different ranges? Document this in your code.

More than one random number can be created by reusing the random generator.

intNum2 = rndGenerator.Next(0,51)

To get a different range of random number you could do the following

intDiceRoll = rndGenerator.Next(1,7)




When the "Check Answer" button is pressed the program should input all 10 of the student’s answers which should then be checked against the actual result of the problem. If the answer is correct, the program should tell the student he got the correct answer by marking each correct problem as correct. If the answer is incorrect the program should inform the student by marking each incorrect problem as incorrect. Blank input should be prompted for an answer. Then the students score and grade should be displayed. This button click event should be implemented with a Loop structure.

For this program to work correctly, you may need to create variables at the module level. Be sure to document in your code why the variables are Module level. Also document that it is module level when you use these variables.

Make sure you worry about what will happen if one of the radio buttons is not pressed. Should you have one choice be default or prevent the user from pressing a button until a choice is made? Document which choice is better and how you implemented this in your code.

You need to do and submit the following:
  • (10 Points.) Create a TOE Chart with correctly identified Tasks, Objects, and Events.
  • (10 Points.) A neat, easy to read and easy to use GUI.
  • (30 Points.) Create Pseudocode or flowcharts for every event for which you will create code.
  • (50 Points.) Create correctly working code, which includes the following
    • Documentation (comments)
    • Properly implemented If statements
    • At least one loop structure, properly implemented
  • Print the TOE Charts and Pseudo code and hand them in with your project.
  • Zip the VB folder and email this to me.
Print out a copy of the code. Do not print the Windows generated code.










Well, I am lost.... This is what my gui looks like...

gui.jpg





Here is my code so far..

Public Class Form1
Inherits System.Windows.Forms.Form
Dim intPrblm = 1, intOneDigit, intTwoDigit, intNUMBERUP As Integer
Dim strOper, strPart1, strPart3 As String

#End Region
Private Sub btnExitBOTTOM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExitBOTTOM.Click
Me.Close()

End Sub
Private Sub btnExitTOP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExitTOP.Click
Me.Close()

End Sub
Private Sub btnGnrteTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGnrteTest.Click
Dim rndGenerator As New Random

If Me.rdoAdd.Checked Then
intNUMBERUP = 1
For intPrblm = 1 To 10
strOper = "+"
intOneDigit = rndGenerator.Next(1, 99)
intTwoDigit = rndGenerator.Next(1, 99)
strPart1 = "lbl_p" & intPrblm & "_" & intNUMBERUP & ".Text =" & intOneDigit
strPart3 = "lbl_p" & intPrblm & "_" & intNUMBERUP + 2 & ".Text =" & intTwoDigit

intPrblm = intPrblm + 1
Next
ElseIf Me.rdoMult.Checked Then
ElseIf Me.rdoSub.Checked Then
Else
MessageBox.Show("Please select which type of problems you would like.", "Attention!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If

End Sub
End Class


Well, There is it.. as u can see I am a beginner.. i dont under loops all that well.. and i was testing several possible ways of accomplishing my assignment.. If you can help me solve my loop problem.. and getting it to the gui.. let me know.. im lost.

Thanks, Kyle.:confused: :confused:
 
this doesnt sound too hard, but since it is homework we're not allowed to do the assignment for you

though what i would do is have 3 integers for each problm, then a boolean for each one that denotes whether the 3rd integer is used or not
meaning: the boolean would be used to see if the equation is: 2+3 or 2+3+4

the loop would be used in the check answer button
you would have 10 integers, one for each answer to the equations
you would need to do the actual calculations for each equation to find out what each correct answer is (you'll need to remember the boolean to find out if the 3rd integer is used or not for each one)
then you simple loop through each of the user's answers, checking to see if their answers match the correct answer

to find out info on using loops you can check http://msdn.microsoft.com
 
Back
Top