|
-
Oct 1st, 2003, 09:53 PM
#1
Thread Starter
Junior Member
Coding Help
Good Evening,
I caused great confusion in my class by trying to ask questions about coding so I am turning to the professionals to help me write this code.
I must create a sub method called InTwo which accepts two integer arguments passed by reference. The code should use 2 input boxes to input the 2 integers from the user.
This is what I put please help me to figure it correctly.
Private Sub InTwo(ByRef intA As Integer, By Ref intB As Integer)
intA = InputBox("Enter the Hours:", {})
intB = InputBox("Enter the Minutes:", {})
End Sub
Part 2 says I must create a function method, which takes two integers, that represent time in hours and minutes. Call the function MinutesIn. The function should return the total time in minutes.
Here is what I put:
Private Function MinutesIn(ByVal intHours As Integer, _
ByVal intMinutes As Integer)
As Integer (why do you have to put that again after you already declared that inside the parenthesis?)
Dim intTotalMinutes As Integer = MinutesIn ({}, {})
intTotalMinutes = (intHours *60) + intMinutes
Return intTotalMinutes
End Function
Part 3 I have no clue on.... We are supposed to create a second function method TimeDifferenceInMins, with 4 ByVal arguments and an integer return result. The function accepts two times in hours and minutes and returns the difference between them in minutes. Use the InTwo and MinutesIn procedures your just wrote.
Any comments or suggestions are greatly appreciated.
JAZ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|