Home > Archive > MCSD > July 2002 > display payroll report





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author display payroll report
ngo_28

2002-06-14, 11:56 am

helpp!!!Please
well, I seem to be having a hard time studying VB 6.0. here is the problem i have run into...
Write a program to display a company’s payroll report in a picture box. The program
should read each employee’s name, hourly rate, and hours worked from a file and produce a report. Using the call statement and loops.

Employees should be paid time-and-a-half for hours in excess of 40.

Payroll Report for a Week

Employee HourlyRate HoursWorked GrossPay

Al Adams, hrlyRate($6.50),hrsWrked(38) grosspay($247.00)

Bob Brown hrlyRate($5.70),hrsWrked(50) (grosspay)$313.50

FinalTotal $550.50

thanks
2lazybutsmart

2002-06-14, 12:07 pm

why a picture box. why do you have to sit in the middle of your fingers. there are alot of other powerfull tools.
hard_coder

2002-06-14, 2:22 pm

Where are you getting these questions?
ngo_28

2002-06-14, 2:30 pm

Questions are coming from one of the college books...badly written
TW2001

2002-06-15, 6:14 am

Programming VB 6 Mcgraw hill had the same question. I used and array of udt`s and looped through it with a command button.If its from that book..i would say read it..Its pretty good..basic(no pun intended) but good.Not that Im a great VB programmer.anyway

First you need to create the file with those records.Parse the file into the array.Not the field titles just the data(delemit it).

You can then write this to a procedure and call it..or call an intrinsic.(just to satisfy your requirement) Then display it any way you want.

I used an input box to ask for the employee name..


If you post some code you will proably get some more help. Nobody is going to do your assignments for you.
ngo_28

2002-06-15, 10:32 am

the question is not from Mcgraw hill book. Yes, I have created a file, declared

Dim empName As Single, hrsWorked As Single, hrlyWage, groPay As Single, WeeklyPay

Private Sub CalculateWeeklyPay()
Call CaculateWeeklyPay(empName, hrWage, hrsWorked)
End Sub

Private Function ShowPayroll(empName, hrWage, hrsWorked, gross_Pay)
If hrsWorked <= 40 Then
gross_Pay = hrsWorked * hrWage
Else
gross_Pay = 40 * hrWage + (hrsWorked - 40) * 1.5 * hrWage
Debug.Print gros_pay
End If
End Function

I haven't got to the point of calling calling the file and stuff.

thanks, anyway...
RichardJW

2002-06-16, 7:13 pm

Are we here to do your homework for you? This is elementary stuff. Really, you should be trying more to work this stuff out by yourself. If you can't do it keep working at it till you can.
paladin

2002-07-27, 3:15 am

Yeah, I know this is an old post, but sheez, empName as *single*!?! Declaring a string value as single? What the hell is up with that? Planning on multiplying the employee's name by his hourly rate, or what? Must be doing sumthin' wid it, since you're passing it into CalculateWeeklyPay (which should be declared as a function anyway, named something like WeeklyPay, not a sub).

Sorry, man, but you *really* need to dig up a clue or two. The best way is not to ask people to do your homework for you, but to sit down and write some stuff. Simple stuff at first, then build on that. Don't get me wrong; I ask questions, too. But I've generally got at least an idea of what's *supposed* to be happening, and am looking for why it isn't. You don't seem to understand even the intrinsic data types with which you're supposed to be working, and without at least that much, you're lost.

==============================
=======
Dim empName As Single, hrsWorked As Single, hrlyWage, groPay As Single, WeeklyPay

Private Sub CalculateWeeklyPay()
Call CaculateWeeklyPay(empName, hrWage, hrsWorked)
End Sub
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net