Follow @deni_in_al
2012-03-28 14:38:59 UTC
Basically, if the user inputs "93," I want it to be seen as a percent, and register in the equation as .93, which would be the decimal/integer (idk which word) for 93%.
Here is the link:
http://www.2shared.com/file/moEtq_6Z/Visual_Basic_Programming_Assig.html
Here is my source code, and ' Calculate the final average' equation may have to change as well for the calculation to be correct.:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Declare variables we will use in the calculations.
Dim dblTests As Double
Dim dblFinalExam As Double
Dim dblQuizzes As Double
Dim dblComputerPrograms As Double
Dim dblResearchPaper As Double
Dim dblDatabaseAssignment As Double
Dim dblInclassPresentation As Double
Dim dblHomeworkLabAssignments As Double
Dim dblSummaryPaper As Double
Dim dblFinalAverage As Double
' Get the test grade from the TextBox control.
dblTests = Tests.Text
' Get the final exam grade from the TextBox control.
dblFinalExam = FinalExam.Text
' Get the quiz grade from the TextBox control.
dblQuizzes = Quizzes.Text
' Get the computer programs exam grade from the TextBox control.
dblComputerPrograms = ComputerPrograms.Text
' Get the research paper grade from the TextBox control.
dblResearchPaper = ResearchPaper.Text
' Get the database assignment grade from the TextBox control.
dblDatabaseAssignment = DatabaseAssignment.Text
' Get the in-class presentation grade from the TextBox control.
dblInclassPresentation = InclassPresentation.Text
' Get the homework lab assignments grade from the TextBox control.
dblHomeworkLabAssignments = HomeworkLabAssignments.Text
' Get the summary paper grade from the TextBox control.
dblSummaryPaper = SummaryPaper.Text
' Calculate the final average.
dblFinalAverage = (dblTests * 0.2) + (dblFinalExam * 0.2) + (dblQuizzes * 0.1) + (dblComputerPrograms * 0.1) + (dblResearchPaper * 0.1) + (dblDatabaseAssignment * 0.1) + (dblInclassPresentation * 0.1) + (dblHomeworkLabAssignments * 0.05) + (dblSummaryPaper * 0.05)
' Assign the final average to a Label control,
' with percent formatting.
FinalAverage.Text = dblFinalAverage
End Sub