0% found this document useful (0 votes)
38 views5 pages

VBQuestions

The document outlines 9 tasks to design interfaces and write code for programs that perform various calculations and validations, including calculating grades, payroll, bonuses, and comparing numbers. It provides instructions on creating interfaces with labels, textboxes, commands, and properties and writing code using variables, input boxes, and IF/THEN statements. Marks are allocated for completing each task based on designing the interface and writing the required code.

Uploaded by

bravemacny
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views5 pages

VBQuestions

The document outlines 9 tasks to design interfaces and write code for programs that perform various calculations and validations, including calculating grades, payroll, bonuses, and comparing numbers. It provides instructions on creating interfaces with labels, textboxes, commands, and properties and writing code using variables, input boxes, and IF/THEN statements. Marks are allocated for completing each task based on designing the interface and writing the required code.

Uploaded by

bravemacny
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Design an application for logging into a system which accepts a user name and password of your
choice and outputs a message whether the login is correct or incorrect. [25 marks]

2.Design an interface and code for a program that accepts marks and displays grades as follows

MARKS GRADE
10-30 E
31-50 D
51-70 C
71-90 B
91-100 A

You are advised to use either the IF….Then……ELSE or the Case Select constructs.[15]

3. Design an interface and code for program that calculates and displays Gross Pay, Taxes and
Net Pay in labels using the information below:
Hours worked=55
Rate = 8.5
Tax Rate=0.56
4 Design an interface with the following properties. [9]

Object Property Setting


Command 1 Caption C&ommission
Name cmdCommission
Forecolour Blue

Label1 Caption Blank


Name lblSales
Border style 1-fixed single

Textbox1 Caption Hours


Name txtDiscount
Backcolour Green

5.A company pays its salespeople bonus according to the sales they would have done as follows:
Sales Bonus
>500 0.3
<500 0.08
(i) Design an appropriate interface for the program. [7]
(ii) Design a program which calculates the bonus for the situation given above. [8]
6.Draw an interface with the following details; [10]

Object Property Setting


frmMinimum Caption Minimum
lbllength Caption Length
Alignment Right justified
txtLength Text Blank
lblWidth Caption Width
Alignment Right justified
txtWidth Text Blank
cmdCalculate Caption Calculate
cmdExit Caption Exit
picResult

(a) A company pays its salespeople bonus according to the sales they would have done as follows:
Sales Bonus
>1000 0.4
<1000 0.09
(j) Design an appropriate interface for the program. [7]
(ii) Design a program which calculates the bonus for the situation given above. [8]

7.Design an interface with the following properties. [12]

Object Property Setting


Form Caption Sales
Name Sales
Back colour Yellow
Command 1 Caption C&ommission
Name Commission
Forecolour Blue
Label1 Caption Blank
Name Sales
Border style 1-fixed single
Textbox1 Caption Hours
Name Discount
Backcolour Green

8.Design a program that accepts marks and displays grades as follows:

MARKS GRADE
10-30 E
31-50 D
51-70 C
71-90 B
91-100 A
.

(a) Design an interface [5]

(b) Write the code for the program using appropriate variables [14]

(c) Run the application [2]

9.Write a program which accepts a Password and outputs a message which states whether
the password is wrong or right

(a) Design interface [2]

(b) Write code using the correct variables [7]

(c) Run application [2]


Dim userMsg As String
userMsg=InputBox(“What is your message?”,”Message Entry Form”,”Enter your message
here”,500,700)
If userMsg<>”” Then
lblMessage.Caption=userMsg
Else
lblMessage.caption=”No message”
Endif

Dim testMsg As string


Testmsg=MsgBox(“Click to test”,1,”Test message”)
If testmsg =1 Then
lblDisplay.caption=”testing successful”
Else
lblDisplay.caption=”testing unsuccessful”
Endif

Object Property Setting

frmMaximum Caption Maximum


lblFirstnumber Caption First Number
Alignment Right justified
txtFirstumber Text Blank
lblSecondnumber Caption Second Number
Alignment Right justified
txtSecondnumber Text Blank
cmdFindlarger Caption Find larger Number
picResult
Dim largernumber As Single
picResult.cls
If Val(txtFirstnumber.Text)>Val(txtSecondnumber.Text)
Largernumber=Val(txtFirstnumber.Text)
Else
Largernumber=Val(txtSecondnumber.Text)
Endif
picResult.Print”The larger number is”;largernumber

You might also like