Solved

Visual Basic Prospective Employee Knowledge Assessment

Posted on 2011-09-02
11
465 Views
Last Modified: 2012-05-12
I found somewhere on the internet an excellent list of questions which you could give to somebody to test their knowledge of Visual Basic 6.

I have tried to find these questions again but have so far been unable.

Can anybody suggest anything?  I need 2 tests one for VB6 and one for VB.NET.

Thanks in advance.
0
Comment
Question by:inthedark
  • 3
  • 3
  • 2
  • +2
11 Comments
 
LVL 14

Assisted Solution

by:VBClassicGuy
VBClassicGuy earned 100 total points
ID: 36473222
For VB6, how about:

1. When creating a table for use with either SQL Server or Access, the data types Single and YesNo for Jet need to be declared as what for SQL? REAL and BIT.

2. What method is called right before a form unloads? FORM_QUERYUNLOAD

3. To empty out a database table but keep the table, should you use the Drop or Delete statement? DELETE

4. Which uses less memory, the PictureBox or Image control? IMAGE

5. Without API calls or special coding, how do you display a PNG picture using standard VB6 controls? YOU CAN'T

6. The value of False is zero. What is the value of True? -1

7. If you insert the text of "1" through "10" into a sorted ListBox, what will the results look like in the ListBox? 1, 10, 2, 3, 4, 5, 6, 7, 8, 9

8. How do you correct the above situation? PAD VALUES WITH LEADING ZEROES SO ALL TEXT IS THE SAME LENGTH

9. Using the default settings of a Label, what will the text "Love & Marriage" look like? LOVE _MARRIAGE

10. What two ways to correct the above situation? USE TWO AMPERSANDS, OR SET THE UseMnemonic PROPERTY TO FALSE
0
 
LVL 46

Accepted Solution

by:
Martin Liss earned 200 total points
ID: 36473957
0
 
LVL 45

Assisted Solution

by:aikimark
aikimark earned 100 total points
ID: 36476978
I'm a big fan of "what's wrong with this code" challenges.  Look at this old EE question:
http:/Q_21013971.html

The questions you ask should be a good indicator of the type of work to be done and expertise level for which you are hiring.  For instance, if this job will be database intensive, you should ask more database questions.

If you this job will be maintaining old code, you should ask questions about the type of code actually found in your system (classes, forms, objects, API calls, etc.)
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 27

Expert Comment

by:Ark
ID: 36479699
"what's wrong with this code" :)

>>data types Single and YesNo for Jet need to be declared as what for SQL? REAL and BIT<<
Yes/No -> BOOLEAN (Synonyms: BIT, LOGICAL, LOGICAL1, YESNO)
Number (FieldSize =Single) -> SINGLE (Synonyms: FLOAT4, IEEESINGLE, REAL)
See http://msdn.microsoft.com/en-us/library/aa211091(v=office.11).aspx

>>What method is called right before a form unloads? FORM_QUERYUNLOAD<<
FORM_QUERYUNLOAD is an EVENT, not METHOD. Furthermore, following code won't fire QueryUnload and Unload events though Unload METHOD was called:
   Dim f As New Form2
   Unload f

>>To empty out a database table but keep the table, should you use the Drop or Delete statement? DELETE<<
Why TRUNCATE is missing? It's much faster and resets autonumber fields as well.

>>Without API calls or special coding, how do you display a PNG picture using standard VB6 controls? YOU CAN'T<<
WebBrowser1.Navigate "yourimage.png"



0
 
LVL 17

Author Comment

by:inthedark
ID: 36484942
Thanks for your help so far.... we interviewed 2 people so far and neither could do the first question; do you thing it was too hard?

1) UK VAT

Background information: In the UK the calculation of VAT is based on the following formula:

VATTotal = GoodsValue * VatRatePercentage /100

The Vat is always rounded to 2 decimal places. So the invoice total is calculated by adding the Goods and VAT:

InvoiceTotal = GoodsValue + VATTotal

Employees give an accountant their expenses which only include amounts including VAT.  The VB programmer needs to write a program to calculate the Goods and VAT values from the invoice total.  The programmer created 2 textboxes one for the entry of an invoice total and one for a VAT rate percentage.  A display button to calculate and display the goods and vat values was also added.

You need to fill in the missing lines so that the goods and VAT values are correctly calculated. Calculate the goods value first.

Private Sub cmdDisplay_Click()

Dim curInvoiceTotal As Currency
Dim curVATRate As Currency
Dim curGoods As Currency
Dim curVAT As Currency
Dim sResult As String


' get the invoicetotal from the textbox
curInvoiceTotal = CCur(txtInvoiceTotal)

' get the vat rate percentage
curVATRate = CCur(txtVATRate)


' ** Fill in the missing code



curGoods =



curVAT =


' Display the result
sResult = "Goods Value: " + Format(curGoods, "0.00") + vbCrLf
sResult = sResult + "VAT Value: " + Format(curVAT, "0.00")

MsgBox sResult, vbInformation, "Goods & VAT Calculator"


End Sub
0
 
LVL 17

Author Comment

by:inthedark
ID: 36484946
For your interest the next 2 questions which nobody could answer..........were these too hard as well?


2) Hex Notation

In the following code:

Dim lMyLong As Long

lMyLong = &H1234
lMyLong = lMyLong / &H100
MsgBox "lMyLong=" + Hex(lMyLong)

What would the message box display?


3) RGB Colours

Screen colours are represented by long value which can be generated by the RGB(Red,Green,Blue) function.

For example RGB(16,17,18) will create a long hex value of &H121110.

Add the missing lines so that you can get the Red, Green & Blue values from a long colour.

Dim sResult As String
Dim lRed As Long
Dim lBlue As Long
Dim lGreen As Long
Dim lColour As Long

lColour = 1184016


lBlue = lColour/&H10000

' ** complete the missing code

lGreen =



lRed =




sResult = "Red: " + CStr(lRed) + vbCrLf
sResult = sResult + "Green: " + CStr(lGreen) + vbCrLf
sResult = sResult + "Blue: " + CStr(lBlue)
MsgBox sResult, vbInformation, "Red Green Blue Values"


0
 
LVL 45

Expert Comment

by:aikimark
ID: 36485008
I don't think are too hard, but it depends on the level of developer you are looking for and type of code they will be maintaining/developing.
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 36485048
Rather than asking specific questions (which will probably either insult or stump him/her) you'd probably be better off trying to determine how they go about solving problems. For example I'd rather hire someone who says that he would go to Experts Exchange or VBForums if he can't figure out how to do something after giving it a reasonable amount of time on his own rather than spending days of his (and the company's) time on it. I would also ask him how he goes about solving problems and if he is familiar with Debug. I'd also contact his references early on to get a idea of how he performed there.
0
 
LVL 27

Assisted Solution

by:Ark
Ark earned 100 total points
ID: 36486125
These questions have nothing to do with programming (and VB6 in particular). They require basic school math skills. Whom are you looking for? Coders? Remove these questions and stay with VB6 syntax knowledge. Developers? Remove all explanations like "calculation of VAT is based on the following formula...", "Screen colours are represented by long value..." and code - leave the task: "Calculate and display Goods and VAT values for UK knowing Invoice total and VAT rate" and examine final code. For example your first question's answer can be:
 
For curGoods=0 To 1000000
     For curVAT=0 to 1000000 Step 0.01
           If curGoods + curVAT = curInvoiceTotal Then
               If  curVAT = curGoods * curVATRate/100 Then Exit For
            End If
     Next
Next

Open in new window

Do you like it?
0
 
LVL 45

Expert Comment

by:aikimark
ID: 36486254
A classic "what's wrong with this code" case is updating a database on a record-by-record basis or coordinating two recordsets instead of doing a table join.
0
 
LVL 17

Author Closing Comment

by:inthedark
ID: 36510178
Thanks for the help. I used suggestions from all of you in the final thing.  Thanks for the humour Ark.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
Why pager replacement is still an issue OnPage has what some might call a “hate/hate” relationship with pagers. Not much room for love. As we see it, pagers are an antiquated bit of technology. Pagers are dinosaurs which, like most dinosaurs, sho…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question