Welcome to Dream.In.Code
Become a VB Expert!

Join 137,228 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,887 people online right now. Registration is fast and FREE... Join Now!




help with assignment....=(

2 Pages V  1 2 >  
Reply to this topicStart new topic

help with assignment....=(

mobrecords07
13 Feb, 2007 - 09:02 PM
Post #1

New D.I.C Head
*

Joined: 13 Feb, 2007
Posts: 13


My Contributions
I know how to set up the form..& i know where to put the code in. I just dont know where the codes go in what place. Please someone help me. Thanks

Input
Input Hours worked
Paycode

Calculation
If the paycode is:

Paycode A=Pay=10
Paycode B=Pay=20
Paycode C=Pay=30

Find totalpay (pay*hours)
If over 40 hours the overtime is time +1/2 of pay
Find the TAX 22%

Output
Paycode
overtime in hours
tax
pay
User is offlineProfile CardPM
+Quote Post

Tiny Grasshopper
RE: Help With Assignment....=(
14 Feb, 2007 - 02:04 AM
Post #2

New D.I.C Head
Group Icon

Joined: 26 Sep, 2006
Posts: 43



Thanked: 1 times
Dream Kudos: 20
My Contributions
I do not understand the question fully.
Do you need help with the code or where the code should go?


Well the code should go into a button click event that will be used to handle the calculate the totalpay


hope it helps
User is offlineProfile CardPM
+Quote Post

eXceed69
RE: Help With Assignment....=(
14 Feb, 2007 - 02:46 AM
Post #3

"Super Sentai Knight Of DawN"
Group Icon

Joined: 12 Nov, 2006
Posts: 682



Thanked: 1 times
Dream Kudos: 675
My Contributions
You post is in approriate , you need to have some effort to help by other member or just read the forum rules. We don't encourage this action you had to show effort to achieve what your concern.


POST YOUR CODE










This post has been edited by eXceed69: 14 Feb, 2007 - 06:34 PM
User is offlineProfile CardPM
+Quote Post

mobrecords07
RE: Help With Assignment....=(
14 Feb, 2007 - 12:24 PM
Post #4

New D.I.C Head
*

Joined: 13 Feb, 2007
Posts: 13


My Contributions
QUOTE(Tiny Grasshopper @ 14 Feb, 2007 - 03:04 AM) *

I do not understand the question fully.
Do you need help with the code or where the code should go?


Well the code should go into a button click event that will be used to handle the calculate the totalpay


hope it helps



I need help with the code, because I'm lost sad3.gif

User is offlineProfile CardPM
+Quote Post

KeyWiz
RE: Help With Assignment....=(
15 Feb, 2007 - 02:05 AM
Post #5

D.I.C Regular
Group Icon

Joined: 26 Oct, 2006
Posts: 428


Dream Kudos: 125
My Contributions
I assume this is your first real assignment?

What programming language/version are you using?

If you place an item on the form, you can double click the object which will place you in the object_click sub routine, this is where you place your code for the user clicking on that object. You can then change the Event to any available event you wish to react to.
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Help With Assignment....=(
15 Feb, 2007 - 04:57 AM
Post #6

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,013



Thanked: 18 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
this site has a strict policy about helping with homework, if you post what you have so far we are more than willing to help you solve problems, if you are having problems getting to being able to code, be sure to ask those questions first, so we can do all we can to help smile.gif
User is offlineProfile CardPM
+Quote Post

mobrecords07
RE: Help With Assignment....=(
15 Feb, 2007 - 09:53 PM
Post #7

New D.I.C Head
*

Joined: 13 Feb, 2007
Posts: 13


My Contributions
QUOTE(KeyWiz @ 15 Feb, 2007 - 03:05 AM) *

I assume this is your first real assignment?

What programming language/version are you using?

If you place an item on the form, you can double click the object which will place you in the object_click sub routine, this is where you place your code for the user clicking on that object. You can then change the Event to any available event you wish to react to.


I'm using Microsoft Visual Studio.NET 2003 and version 7.1

Yes, I know about double-clicking an object and it takes me to place the code, but what I posted earlier is the "project", and I don't know what code to write. Ya feel me?
User is offlineProfile CardPM
+Quote Post

KeyWiz
RE: Help With Assignment....=(
16 Feb, 2007 - 11:56 AM
Post #8

D.I.C Regular
Group Icon

Joined: 26 Oct, 2006
Posts: 428


Dream Kudos: 125
My Contributions
First of all, did you know you can get a free version of VB2005?
It comes with a great beginners tutorial series on programming.
I sugest you start there.

If you are doing a class project, then everything I told you above should have been enough, but.

Put your objects on the form, textboxes for input, labels for output, a button to initiate the calculations.
in the Button_Click subroutine, place your formula for calcultions, and out put to the labels.

If this isn't enough to go on, get VB2005 and go through their tutorial, it can teach you more in one hour than you will learn through us, one little step at a time.

We are not here to PROVIDE HOMEWORK SOLUTIONS, we are here to provide assistance with UNDERSTANDING. Some people here don't get that, but thats the intent of this site.
User is offlineProfile CardPM
+Quote Post

the_hangman
RE: Help With Assignment....=(
16 Feb, 2007 - 01:39 PM
Post #9

D.I.C Addict
Group Icon

Joined: 18 Jan, 2006
Posts: 593



Thanked: 1 times
Dream Kudos: 200
My Contributions
If this is a school assignment, my suggestion is to start paying attention. I've never taken a class where we had an assigment on something that we never learned.
User is offlineProfile CardPM
+Quote Post

mobrecords07
RE: Help With Assignment....=(
20 Feb, 2007 - 02:37 PM
Post #10

New D.I.C Head
*

Joined: 13 Feb, 2007
Posts: 13


My Contributions
this is what I did so far...some1 help me out


IPB Image



This post has been edited by mobrecords07: 20 Feb, 2007 - 03:02 PM
User is offlineProfile CardPM
+Quote Post

mobrecords07
RE: Help With Assignment....=(
20 Feb, 2007 - 03:03 PM
Post #11

New D.I.C Head
*

Joined: 13 Feb, 2007
Posts: 13


My Contributions
CODE
Inherits System.Windows.Forms.Form
    Dim paycode As String
    Dim Hours As Integer
    Dim dblpaycode As String
    Dim dblpay As Double
    Dim dbltotalpay As Double


#Region " Windows Form Designer generated code "

    

    End Sub

#End Region

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub btnenter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnenter.Click
        'Input
        paycode = Val(txtpaycode.Text)
        Hours = Val(txthours.Text)

        'Calc
        If (dblpaycode = "A") Then
            dblpay = 10

        ElseIf (dblpaycode = "B") Then
            dblpay = 20

        ElseIf (dblpaycode = "C") Then
            dblpay = 30
        End If

        If (Hours <= 40) Then
            dbltotalpay = Hours * 40
        Else
            dbltotalpay = (Hours - 40)

        End If

        'Output
        Label6.Text = dblpay

User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Help With Assignment....=(
20 Feb, 2007 - 03:20 PM
Post #12

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,859



Thanked: 50 times
Dream Kudos: 550
My Contributions
Now we are getting somwhere! You have the basic idea but I wonder if you are understanding your assignment.

I assume that the paycode tells the hourly rate so as you said in your original post:
RegularPay = Hours * Pay (which would be 10, 20, or 30)
then if Hours > 40 then you need to calculate some over time pay:
OverTime = (Hours - 40) * (pay + pay/2)
so now
TotalPay = RegularPay + TotalPlay
Of course you still need to subtract tax and what not.

Don't get caught up in the coding. If you can solve the problem on paper then learning how to code it is easy. Look at how you would calculate each value on paper if you can't do it while looking at the computer screen.
User is offlineProfile CardPM
+Quote Post

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 03:08PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month