100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Essay

Event Driven Programming Assignment 1

Rating
-
Sold
-
Pages
22
Grade
A
Uploaded on
08-05-2022
Written in
2017/2018

The document contains all criteria for assignment 5: Unit 14 Criteria: P2, P3, P4, P5, P6, M2, M3, M4, D2. Unit 6 Criteria P6, M2, D2. I received full marks for this assignment.










Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
May 8, 2022
Number of pages
22
Written in
2017/2018
Type
Essay
Professor(s)
Unknown
Grade
A

Content preview

UNIT 14 – P2/P4


The start button starts the
code and the package starts
to move after this button is
clicked. These labels show the user
how many total packages
there are of that specific
type.




The reset button allows the user
to click it to start the process
over so that the package moves
These labels show the
to the beginning of the conveyor
percentage of unsealed and
belt. These red boxes are the
the number of unsealed
packages. sensors, these were used
within the code to detect
the different package types.

, 1 Public Class Form1
2 Dim Type As Integer
3 Dim Sealed As Boolean
4 Dim NumbSmall As Byte 'This adds the NumbSmall as a varible and stores it as a
byte
5 Dim NumbMedium As Byte 'This adds the NumbMedium as a variable and stores as byte
6 Dim NumbLarge As Byte 'This adds NumbLarge as a variable and stores it as a byte
7 Dim NumbTotal As Byte '
8 Dim NumbUnsealed As Byte
9 Dim NumbUnSeal As Byte
10
11 Private Sub BtnStart_Click(sender As Object, e As EventArgs) Handles
BtnStart.Click
12 Type = 0
13 Randomize()
14 Type = Type + Int(Rnd() * 4) + 1 'this defines the amount of images it shows
15 Sealed = Sealed + Int(Rnd() * 2) + 1 'this is a true or false for the
unsealed packages
16
17 TmrMove.Enabled = True
18
19 Select Case Type
20 Case 1 'This is a Small Package Case
21 PicPackage.Image = My.Resources.Small_Box1
22
23 Case 2 'Medium Package Case
24 PicPackage.Image = My.Resources.Medium_Box
25
26 Case 3 'Case for the Large Package
27 PicPackage.Image = My.Resources.Large_Box
28
29 Case Else
30 PicPackage.Image = My.Resources.Unsealed
31
32 End Select
33
34
35 End Sub
36
37 Private Sub CheckCollision()
38
39 If PicPackage.Bounds.IntersectsWith(PicSensorS.Bounds) = True And Type = 1
Then
40 TmrMove.Enabled = False
41 MessageBox.Show("Small Package Detected")
42 NumbSmall = NumbSmall + 1 'this adds up the Small Packages so that the
total shows next to the label
43 LblNumbSmall.Text = NumbSmall
44 NumbTotal = NumbTotal + 1
45 LblTotal.Text = NumbTotal.ToString
46
47 ElseIf PicPackage.Bounds.IntersectsWith(PicSensorM.Bounds) = True And Type =
2 Then
48 TmrMove.Enabled = False
49 MessageBox.Show("Medium Package Detected")
50 NumbMedium = NumbMedium + 1 'this adds up the Medium Packages so that
the total shows next to the label
51 LblNumbMedium.Text = NumbMedium
52 NumbTotal = NumbTotal + 1
53 LblTotal.Text = NumbTotal.ToString
54
55 ElseIf PicPackage.Bounds.IntersectsWith(PicSensorL.Bounds) = True And Type =
3 Then
56 TmrMove.Enabled = False
57 MessageBox.Show("Large Package Detected")
58 NumbLarge = NumbLarge + 1 'this adds up the Large Packages so that the
total shows next to the label
59 LblNumbLarge.Text = NumbLarge
60 NumbTotal = NumbTotal + 1
61 LblTotal.Text = NumbTotal.ToString
62
£7.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
ItsKenzie
5.0
(9)

Also available in package deal

Thumbnail
Package deal
Event Driven Programming Assignments
-
2 2022
£ 15.98 More info

Get to know the seller

Seller avatar
ItsKenzie University
View profile
Follow You need to be logged in order to follow users or courses
Sold
20
Member since
6 year
Number of followers
10
Documents
78
Last sold
2 year ago
IT and Cyber Security Notes For Computing Students

I prepare and sell top quality notes and essays that are concise and easy to understand to fellow computing students. It can be overwhelming when you get your first few projects or assignments, using my notes and essays can help you to better understand the modules and hopefully help you get the grades you want. Thanks for visiting my profile, feedback is always appreciated.

5.0

9 reviews

5
9
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions