Hi there im very new to VB.net. However ive bee told its the best place for me to start if i want to program a small application for use with my family business.

Basically i want to be able to enter the type of employee. Either (Manager, Help Desk or sales) and the system to output the amount i should pay them based on the hours they work in a week.

I pay my Sales people: £6.43 per hour
I pay my Help desk emoyees: £5.63
I pay my manager: £8.23

Please any help would be appreciated, ive purchased a VB.NET book, but i have no idea where to start. Thankyou

Recommended Answers

All 13 Replies

Well you need to read the book and do what it says, if you can't figure out what it's telling you post here and we'll try and help.

It's hard to say where to start other than the above becuase I have no idea from your post what you know don't know about computers and programming them.

What PC do you have is it running XP service pack2 ? in which case the .NET frame work is most likely installed and you can start straight away. Did the book include a CDROM with Visual Studio Express Edition? some of them do, if so install it and follw the exercises in the book.

Basically you need to learn the VB syntax (computer instructions) from the book and VB sites on the internet. You place the syntax of your program in a file and use the compiler of the .NET Framework to turn it into an executable program that the .NET Framework can then run on your computer.

If you download Visual Studio Express Edition (it's free) this will help make the above tasks easier, it is an IDE (Integrated Developent Environment) designed to help you create, manage compile and debug the files that make up your program.

Im using SP2, i understand what an IDE is, and am familier with basic VB.NET commands.

I just want to be able to enter emplyee type and hours worked and recieve a box saying how much i should pay them.

My first suggestion would be to code what you do know how to code, and post what you have here, and we can try to help you along. There are several ways of performing the task that you've described, each has their pro's and con's. This project could easily be completed using a simple MS Excel spreadsheet, however I understand that you would prefer to design something in VB.NET, which is fine. That's why we're all here. :) That being said, maybe something I've said in this post might nudge you in the right direction in VB.NET :)

Ive managed to struggle through to develop this program in VB.NET:

http://putstuff.putfile.com/13128/1460041

I now wish to add the password "trebor" to the system, does anyone have any idea how id implement this password. Is it just a line of code? Thanks, sorry for being a n00b

Member Avatar for Dukane

To do a very simple password protect, you could simply ask for the password in the beginning, Then, check to see if the entered word equals the defined password, "trebor". If it does, allow the program to continue, otherwise show an error message and then close the program.

The thing about computer programming is that you make the comptuer do whatever you want it to. So asking a question like "what do I do about this?" is really subject to your own interpretation.

As for the rest of the program, write out the psedocode as far as what procedures are going to be carried out, or draw a flowchart. For instance:
1. Check the password.
2. Check to see what employee was selected.
3. Check the number of hours the employee worked.
4. Multiply the number of hours worked by the pay rate for that employee.
5. Display message with calculated pay total.

Naturally that could be implemented in any number of ways. If you have a pre-set and unchanging number of employee types and pay rates, this this is a very straight forward process.

Post some of your code and we can then point you in the right direction and help solve any problems you are having. Without any code we can't really help you fix anything!

To do a very simple password protect, you could simply ask for the password in the beginning, Then, check to see if the entered word equals the defined password, "trebor". If it does, allow the program to continue, otherwise show an error message and then close the program.

Thanks, i understand this process that you have described but even after reading my book im still clueless. The password is the next step which i wish to implement for obvious reasons, once ive done that i think ill be in a good position to progress myself.

Member Avatar for Dukane

Ok well here is one possible quick password checking routine:

Public Function CheckPassword(ByVal Password as String) 
[INDENT]If Password = "trebor" Then
[INDENT]Return True
[/INDENT]Else
[INDENT]Return False
[/INDENT]End If
[/INDENT]End Function

You would call this function and check to see if it returns true or false. If the function returns true, the password was correct. If false, the password was wrong.

So, if the return is true then proceed. Otherwise, exit or display an error message or do whatever you want to do.

Thanks ive got this sorted, now how would i change the code to put a limit on the amount of hours an employee works, for example if i was to put a cap on a Manager only working 40 hours. Is it something to do with if ">40 then" please help.

Thanks ive got this sorted, now how would i change the code to put a limit on the amount of hours an employee works, for example if i was to put a cap on a Manager only working 40 hours. Is it something to do with if ">40 then" please help.

Please help, i dont know how to apply a maximum amount of hours a person can work. Would i use an IF statement?

Member Avatar for Dukane

It really seems like you've but off more than you can chew here. Why don't you show us what you have done so far and point out specific parts of your code that you're having trouble with instead of having (me/us) write the program for you.

Think of everything that your program must do in English-like statements.

For instance, to apply a cap to the number of hours someone works, what would you want to do? First you want to CHECK the number of hours that person worked. IF they work a certain number of hours, do something. OTHERWISE, do something else.

And apply that style reasoning to every function your program must do.

Think of everything that your program must do in English-like statements.

OK sorry here we go, i want the system to:

  • Have a password. (trebor is the password i wish to use)
  • Have a dropdown box with three employee types
  1. Sales - can work for a min of 10 hours and max of 20 hours @ £6.43 per hour.
  2. Help Desk - has to work a fixed 35 hour week at £5.63 per hour
  3. Manager - fixed 30 hour week = £516.87 per week

Overtime - is available for Sales & Help Desk ONLY - paid at double time.

Tax - None for the first £50, then £50+ 13p per pound


Outputs

  • Gross Pay
  • Net Pay (after tax deductions)

My .sln files and all of my code can be downloaded from:

<URL snipped>

Thankyou very much

Member Avatar for Dukane

You cannot post URL's like that on the forum.

That aside, now you must go further. You give a description of what the program is to do, now you must break each function down into steps like I have done for you several times in this thread.

I have already given you code for a password, and pointed you in the right direction for several other problems.

From what I am reading, it seems you have no idea what you're doing. Why not get someone more qualified who would at least know where to begin on a project like this?

Hi there im very new to VB.net. However ive bee told its the best place for me to start if i want to program a small application for use with my family business.

Basically i want to be able to enter the type of employee. Either (Manager, Help Desk or sales) and the system to output the amount i should pay them based on the hours they work in a week.

I pay my Sales people: £6.43 per hour
I pay my Help desk emoyees: £5.63
I pay my manager: £8.23

Please any help would be appreciated, ive purchased a VB.NET book, but i have no idea where to start. Thankyou

idk about visual basic but i just programmed a wage calculator for true basic tbbronze tb is as follows...

SET WINDOW -13, 0, 1, 13
SET BACK "BLACK"
SET COLOR "WHITE"
CLEAR

INPUT prompt "What is your name? ": name$

PRINT "HELLO"
PRINT name$
PRINT
PRINT
INPUT prompt "What is your hourly wage? ": hourlywage
PRINT
PRINT
INPUT prompt "How many hours have you worked? ": hoursworked
PRINT
PRINT
CLEAR

LET grosspay = hourlywage * hoursworked

IF hoursworked > 40 then
LET overtime = hoursworked - 40
END IF

IF hoursworked > 40 then
LET overtimepay = hourlywage * 1.5
END IF


LET subtotal = hourlywage * hoursworked +overtime + overtimepay

LET fedtax = subtotal * .113
LET statetax = subtotal * .028
LET localtax = subtotal * .011
LET sstax = subtotal * .0765

PRINT "Name."; name$

PRINT
PRINT
PRINT "Hourly Wage"; hourlywage
PRINT
PRINT
PRINT "Hours Worked"; hoursworked
PRINT
PRINT
PRINT "Gross pay"
PRINT using "$#,###.##": grosspay
PRINT
PRINT "Overtime hours"; overtime
PRINT
PRINT "Overtime pay"; overtimepay
PRINT
PRINT "Subtotal"
PRINT using "$#,###.##": subtotal
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT "**********"
PRINT "DEDUCTIONS"
PRINT "**********"
PRINT
PRINT
PRINT "Federal tax"
PRINT using "$#,###.##": fedtax
PRINT
PRINT
PRINT "State tax"
PRINT
PRINT using "$#,###.##": statetax
PRINT
PRINT
PRINT "Local tax"
PRINT
PRINT using "$#,###.##": localtax
PRINT
PRINT
PRINT "Social Security Tax"
PRINT
PRINT using "$#,###.##": sstax

!WAGE PROGRAM
!IP EMPLOYEE NAME
!IP HOURLY WAGE
!IP NUMBER OF HOURS WORKED
!OP CALCULATE WEEKLY WAGE (OVERTIME) 40 + HOURS TIME AND A HALF * 1.5
!EMPLOYEE GROSS/NET PAY
!DEDUCTIONS
!FED TAX 11.3%
!STATE TAX 2.8%
!LOCAL 1.1%
!S.S. 7.65


END

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.