Please help me.

ndnpimmp

Member
Joined
Mar 13, 2013
Messages
6
Programming Experience
Beginner
I joined a vb.net class at school. The teacher dropped two projects on me and tomorrow is the midterm. I don't know who else to ask for help. Can someone help me understand this? I have Microsoft Visual Studio 2010 installed.

Project 1 :: imgur: the simple image sharer
 
What exactly do you not understand? It's fairly basic stuff: create a form, add a few controls, gather some input, perform some calculations and display the results. It's hard to describe it in simpler terms than what's in the assignment paper unless we know what the issue is. If you don't know anything about those basics then you're in real trouble and I would suggest that you spend a bit of time coming to grips with the fundamentals. You might benefit from going through a few chapters at least of this:

Microsoft Visual Basic .NET tutorials for Beginners
 
I'm having trouble with the code. I am totally lost. Everyone seems to have a different way to solve this problem. They try to help me but I don't understand the the way they explain it.
 
I'm sorry if this sounds harsh, but if you really don't understand no matter how many ways people explain it to you, you should probably have paid a bit more attention in class. Failing the midterm should be enough consequence to make sure you do pay attention next time.

The calculus is let's say difficult to understand if like me you dropped out of college and never got to learn the symbols, but the written explanation and 2 hours of paying attention in class should be plenty to solve this problem in under an hour. Pretty sure the teacher didn't drop those two projects on you today, or even last week, maybe you should have laid off the parties for one weekend.

People like you made school horribly boring for people like me back in the days.
 
Last edited:
I'm sorry if this sounds harsh, but if you really don't understand no matter how many ways people explain it to you, you should probably have paid a bit more attention in class. Failing the midterm should be enough consequence to make sure you do pay attention next time.

The calculus is let's say difficult to understand if like me you dropped out of college and never got to learn the symbols, but the written explanation and 2 hours of paying attention in class should be plenty to solve this problem in under an hour. Pretty sure the teacher didn't drop those two projects on you today, or even last week, maybe you should have laid off the parties for one weekend.

People like you made school horribly boring for people like me back in the days.

No I didn't do that. I took this class because it fills a requirement for my major. The teacher let me in late even after the deadline. I am on good terms with everyone but I can't bother the teacher to help me catch up. That's why I'm asking here. Pass or Fail that MidtermI'm still sticking with the class.
 
So you've created the user interface then?

Yes, I had a working user interface and some code I put together but the saved file is for MS VB 2012 now I have 2010 and it can not open the project.


Calculator.JPG
 
This was my code from the first attempt.


Public Class Form1

Private Sub BindingSource1_CurrentChanged(sender As Object, e As EventArgs)

End Sub

Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click

End Sub

Private Sub Label5_Click(sender As Object, e As EventArgs) Handles Label5.Click

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
TextBox7.Text = (Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text)) / 6
TextBox8.Text = (((Val(TextBox1.Text) - Val(TextBox7.Text)) ^ 2) + ((Val(TextBox2.Text) - Val(TextBox7.Text)) ^ 2) + ((Val(TextBox3.Text) - Val(TextBox7.Text)) ^ 2) + ((Val(TextBox4.Text) - Val(TextBox7.Text)) ^ 2) + ((Val(TextBox5.Text) - Val(TextBox7.Text)) ^ 2) + ((Val(TextBox6.Text) - Val(TextBox7.Text)) ^ 2)) / 5
TextBox9.Text = Math.Sqrt(Val(TextBox8.Text))
End Sub

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

End Sub

Private Sub TextBox7_TextChanged(sender As Object, e As EventArgs)

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
End
End Sub
End Class
 
This is all information that you should have given us up front. ALWAYS: this is what I want, this is what I've got, this is what happens.

Anyway, the first thing you should do is to give everything a meaningful name. None of those names mean anything so it's very easy to use the wrong control.

As for the code, the first step is to get all the inputs from the TextBoxes, convert them and assign them to variables of the appropriate type. You then calculate the mean using those variables and assign that to a variable. You then calculate the variance using all the previous variables and assign that result to another variable. Calculate the stdev from the variance and assign to another variable. Once you've got all your results, then you display them in the appropriate controls.
 
This is all information that you should have given us up front. ALWAYS: this is what I want, this is what I've got, this is what happens.

Anyway, the first thing you should do is to give everything a meaningful name. None of those names mean anything so it's very easy to use the wrong control.

As for the code, the first step is to get all the inputs from the TextBoxes, convert them and assign them to variables of the appropriate type. You then calculate the mean using those variables and assign that to a variable. You then calculate the variance using all the previous variables and assign that result to another variable. Calculate the stdev from the variance and assign to another variable. Once you've got all your results, then you display them in the appropriate controls.


What do you mean give everything a meaningful name? In my code or interface?

Step 1: Rebuild the interface like before.
Step 2: Assign a name to all fields?
Step 3: Get inputs from the TextBoxes, convert them and assign them to variables of the appropriate type. How?
 
If you can set the Text of your Labels then you can set the Name of each control too.

You're already getting the input from each TextBox and converting it to a number so you just have to assign that number to an appropriate variable. I'm afraid that I'm not prepared to explain how to declare and set a variable because, much as it would take me seconds to do so, it's something so basic and fundamental that, if you can't do that then you can't do anything. If you're doing a class and you haven't learned that then there's something seriously wrong so you need to consult your notes and/or text book and/or some online resources. That's akin to having to explain to someone who wants to learn to drive how to open the car door. If they're not capable of getting that bit right then they're really not equipped to go any further. Show that you can do the absolute basics that you have presumably already been taught and I'm more than happy to help you put those basic concepts together to do more complex things but I'm afraid that I at least am not about spoon-feeding; more about helping those who help themselves.
 
Back
Top