vp prefinal project docu
TRANSCRIPT
-
8/6/2019 VP Prefinal Project Docu.
1/39
MABINI COLLEGES
COMPUTER STUDIES DEPARTMENT
CLASS SCHED TTH 5-30-7:00 PM
VP 1 PROGRAMS
A PROJECT IN VISUAL PROGRAMMING 1
ELVIS I. ALTOVAR & KIEL PAULO M.LAYUG
-
8/6/2019 VP Prefinal Project Docu.
2/39
______________________________________________________________________
VP_7_ Percentile Grade
PublicClass GradesPrivateSub btnOK_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOK.ClicktxtGrade.Focus()Dim GRADE AsDoubleGRADE = txtGrade.TextIf GRADE >= 75 And GRADE < 77 Then
txtAnswer.Text = txtGrade.Text & "% equivalent to 3.00"ElseIf GRADE >= 77 And GRADE < 80 Then
txtAnswer.Text = txtGrade.Text & "% equivalent to 2.75"ElseIf GRADE >= 80 And GRADE < 82 Then
txtAnswer.Text = txtGrade.Text & "% equivalent to 2.50"ElseIf GRADE >= 82 And GRADE < 85 Then
txtAnswer.Text = txtGrade.Text & "% equivalent to 2.25"ElseIf GRADE >= 85 And GRADE < 89 ThentxtAnswer.Text = txtGrade.Text & "% equivalent to 2.00"
ElseIf GRADE >= 89 And GRADE < 92 ThentxtAnswer.Text = txtGrade.Text & "% equivalent to 1.75"
ElseIf GRADE >= 92 And GRADE < 95 ThentxtAnswer.Text = txtGrade.Text & "% equivalent to 1.50"
ElseIf GRADE >= 95 And GRADE < 98 ThentxtAnswer.Text = txtGrade.Text & "% equivalent to 1.25"
ElseIf GRADE >= 98 And GRADE
-
8/6/2019 VP Prefinal Project Docu.
3/39
Start
Input grade
if grade
>= 75 and
= 77
and =80
and =82
and = 85
and =89
and=92
and=95
and=98
and
-
8/6/2019 VP Prefinal Project Docu.
4/39
______________________________________________________________________
VP_8_ Astrology
PublicClass Astrology
PrivateSub btnclear_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnclear.Click
txtmonth.Text = ""txthoro.Text = ""lblZodiac.Text = ""
EndSub
PrivateSub btnOK_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnOK.Click
Dim MONTHS AsDateMONTHS = txtmonth.Text
MONTHS = (MONTHS.ToShortDateString)
If MONTHS >= "march/21"And MONTHS = "april/20"And MONTHS
-
8/6/2019 VP Prefinal Project Docu.
5/39
approach their deadlines, Aries. You may put in more time than usual. Tempersmight flare and co-workers clash, so stay calm and keep going. On thepositive side, the financial and recognition payoffs for whatever youaccomplish today should prove well worth the effort.", "Your in a Cusp")
ElseIf MONTHS = CDate("5/19") Or MONTHS = CDate("5/20") ThenMessageBox.Show("You are in a cusp" & vbNewLine & "Gemini" &
vbNewLine & "Money is probably on your mind now, Gemini. A desire forincreased financial security could force you to look for work or investmentsthat would pay off big. Opportunities for one or both of these are likely tocome through friends, perhaps someone with whom you've worked before. You'relikely to accomplish what you want for now, but it's uncertain whether you'llcontinue on this path in the future.", "Your in a Cusp")
EndIfElseIf MONTHS >= "may/21"And MONTHS = "june/21"And MONTHS
-
8/6/2019 VP Prefinal Project Docu.
6/39
lunch hour. Don't be afraid to put off nonessential tasks. You'll be allright. Why make a day's work any more difficult than it needs to be?", "Yourin a Cusp")
EndIfElseIf MONTHS >= "july/23"And MONTHS = "august/23"And MONTHS = "september/23"And MONTHS
-
8/6/2019 VP Prefinal Project Docu.
7/39
wonderful the place looks. Conversation should be lively and entertaining,though you should sidestep any discussion of controversial subjects. Debateson such matters could get rather heated. It might be wise to treat yourguests to food rather than alcohol!"
If MONTHS = CDate("9/23") Or MONTHS = CDate("9/24") ThenMessageBox.Show("You are in a cusp" & vbNewLine & "Virgo" &
vbNewLine & "This should be a fortunate day for you, Virgo. Everything youtry to do should go fairly smoothly. Relations with others are warm,friendly, and congenial. Any chores or other pending work should be completedquickly and efficiently. If you've been planning to start a new project, thisis the day to get going. Romance should be intense and passionate now, somake the most of it!", "Your in a Cusp")
ElseIf MONTHS = CDate("10/21") Or MONTHS = CDate("10/22") ThenMessageBox.Show("You are in a cusp" & vbNewLine & "Scorpio" &
vbNewLine & "Today, Scorpio, you might spend a great deal of time in the carrunning errands in the neighborhood. You're likely to see people you know whohave interesting news. New businesses may open nearby. Doctors, dentists, andother professionals could open new offices, making your daily routine moreconvenient. Some of them might be your neighbors or relatives.", "Your in aCusp")
EndIfElseIf MONTHS >= "october/23"And MONTHS = "november/22"And MONTHS
-
8/6/2019 VP Prefinal Project Docu.
8/39
running errands in the neighborhood. You're likely to see people you know whohave interesting news. New businesses may open nearby. Doctors, dentists, andother professionals could open new offices, making your daily routine moreconvenient. Some of them might be your neighbors or relatives.", "Your in aCusp")
ElseIf MONTHS = CDate("12/20") Or MONTHS = CDate("12/21") ThenMessageBox.Show("You are in a cusp" & vbNewLine & "Capricorn"
& vbNewLine & "The special someone in your life may be having some troublewith colleagues. Don't just comfort him or her, Capricorn. It's unlikely thatyour sweetie wants sympathy. Solutions are needed. If you don't have any,just be a good listener. It's important for you to get out and exercise. Ifthe weather is good, take a walk. If not, attend an exercise class. You'llfeel better.", "Your in a Cusp")
EndIfElseIf MONTHS >= ("december/22") And MONTHS = ("january/01") And MONTHS = "january/20"And MONTHS
-
8/6/2019 VP Prefinal Project Docu.
9/39
MessageBox.Show("You are in a cusp" & vbNewLine & "Capricorn"& vbNewLine & "The special someone in your life may be having some troublewith colleagues. Don't just comfort him or her, Capricorn. It's unlikely thatyour sweetie wants sympathy. Solutions are needed. If you don't have any,just be a good listener. It's important for you to get out and exercise. Ifthe weather is good, take a walk. If not, attend an exercise class. You'llfeel better.", "Your in a Cusp")
ElseIf MONTHS = CDate("02/17") Or MONTHS = CDate("02/18") ThenMessageBox.Show("You are in a cusp" & vbNewLine & "Pisces" &
vbNewLine & "Friends could entice you to join them for a short day trip,perhaps to the country. This is a great day to go on such an outing, Pisces.You've probably been working hard and need to get away for a while. Don't besurprised if there's a delay, however. You or one of your friends could bewaiting to meet with someone.", "Your in a Cusp")
EndIfElseIf MONTHS >= "february/19"And MONTHS
-
8/6/2019 VP Prefinal Project Docu.
10/39
Pseudocode/Algorithm:
The user will input his or
her Birthday(Month andday of the month).
If the inputted Birthday
is at the range of march
21 to April 19 it will
display Aries and its Horoscope. And if the birthday is
equal to march 21 or 22 it will also display Pieces and
its Horoscope, it is because of the cusp, also the april
18 or 19 which will display Taurus and its horoscope.
ElseIf the inputted Birthday is at the range of april 20
to may 20 it will display Taurus and its Horoscope.
And if the birthday is equal to april 20 or 21 it will also
display Aries and its Horoscope, it is because of the cusp, also the may 19 or 20 which
will display Gemini and its horoscope.
ElseIf the inputted Birthday is at the range of may 21 to june 20 it will display Gemini
and its Horoscope. And if the birthday is equal to may 21 or 22 it will also display
Taurus and its Horoscope, it is because of the cusp, also the june 19 or 20 which will
display Cancer and its horoscope.
ElseIf the inputted Birthday is at the range of june 21 to july 22 it will display Cancer
and its Horoscope. And if the birthday is equal to june 21 or 22 it will also display
Gemini and its Horoscope, it is because of the cusp, also the july 21 or 22 which will
display Leo and its horoscope.
ElseIf the inputted Birthday is at the range of july 23 to august 22 it will display Leo
and its Horoscope. And if the birthday is equal to july 23 to 24 it will also display
Cancer and its Horoscope, it is because of the cusp, also the august 21 to 22 which
will display Virgo and its horoscope.
ElseIf the inputted Birthday is at the range of august 23 to september 22 it will display
Virgo and its Horoscope. And if the birthday is equal august 23 or 24 it will also
display Leo and its Horoscope, it is because of the cusp, also the September 21 or 22
which will display Libra and its horoscope.
-
8/6/2019 VP Prefinal Project Docu.
11/39
ElseIf the inputted Birthday is at the range of september 23 to october 22 it will display
Libra and its Horoscope. And if the birthday is equal to September 23 or 24 it will also
display Virgo and its Horoscope, it is because of the cusp, also the October 21 or 22
which will display Scorpio and its horoscope.
ElseIf the inputted Birthday is at the range of october 23 to november 21 it will display
Scorpio and its Horoscope. And if the birthday is equal to October 23 or 24 it will also
display Libra and its Horoscope, it is because of the cusp, also the November 20 or 21
which will display Sagittarius and its horoscope.
ElseIf the inputted Birthday is at the range of november 22 to December 21 it will
display Sagittarius and its Horoscope. And if the birthday is equal to November 22 or
23 it will also display Scorpio and its Horoscope, it is because of the cusp, also the
December 20 or 21 which will display Capricorn and its horoscope.
ElseIf the inputted Birthday is at the range of December 22 to January 19 it will display
Capricorn and its Horoscope. And if the birthday is equal to December 22 or 23 it will
also display Sagittarius and its Horoscope, it is because of the cusp, also the January
18 or 19 which will display Aquarius and its horoscope.
ElseIf the inputted Birthday is at the range of january 20 to february 18 it will display
Aquarius and its Horoscope. And if the birthday is equal to January 20 or 21 it will
also display Capricorn and its Horoscope, it is because of the cusp, also the February
17 or 18 which will display Pisces and its horoscope.
ElseIf the inputted Birthday is at the range of February 19 to march 20 it will display
Pisces and its Horoscope. And if the birthday is equal to January 20 or 21 it will also
display Capricorn and its Horoscope, it is because of the cusp, also the February 17 or
18 which will display Pieces and its horoscope.
-
8/6/2019 VP Prefinal Project Docu.
12/39
Start
Input Birthday
If birthday
=march 21
to april 19
TT
if birthday
= march 21
or 22 TT
"Horoscope of
Aries and
Pisces"
Elseif
birthday = april
18 or 19 TT
"Horoscope of
Aries and
Taurus"
Else
"Horoscope
of Aries"
FF
FF
FF
Elseif
birthday =
april 20 tomay 20
TT
if birthday
= april 20
or 21 TT
"Horoscope of
Aries and
Taurus"
Elseif
birthday =may
19 to 20 TT
"Horoscope of
Gemini and
Taurus"
Else
"Horoscope
of Taurus"
FF
FF
FF
12
-
8/6/2019 VP Prefinal Project Docu.
13/39
E
s
y
m y
j
b
h
y
my
H
sc
G
m
s
E
s
b
h
y
j
H
sc
G
m
C
c
E
s
H
sc
G
m
!!
!!
!!
E
s
b
h
y
j
j
y
b
h
y
j
H
sc
G
m
C
c
E
s
b
h
y
j
y
H
sc
L
C
c
E
s
H
sc
C
c
!!
!!
!!
-
8/6/2019 VP Prefinal Project Docu.
14/39
"
#
E$
%
& ' (
b'
)
0h
1
2y
3
j4
$ y#
5 0 6 2
4
7
4%
0
# #
88
' (
b'
)
0
h1
2
y3
j4
$ y#
5
6
)
#
9
88
@ A 6
)
6
%
c6
B
&
6 (
C 2
D
c&
)
2
D
1
L& 6 @
E$
%
& ' (
b'
)
0
h1
2
y3
A4
g4
%
0
#
"
0 6
# #
88
@ A 6
)
6
%
c6
B
&
6 (
L& 6
2
D
1
V'
)
g6 @
E$
%
&
@ A 6
)
6
%
c6
B
&
6 (
L& 6 @
EE
EE
EE
E$
%
& ' (
b'
)
0h
1
2y
3
A4
g4
%
0
#
5
0 6
%
&
B
0 & Fb
&
)
# #
88
' (
b'
)
0
h1
2
y3
24
g4
%
0 #
5
6
)
#
9
88
@ A 6
)
6
%
c6
B
&
6 (
L& 6
2
D
1
V'
)
g6 @
E$
%
& ' (
b'
)
0h
1
2y
3
S&
B
0
#
"
6
)
# #
88
@ A 6
)
6
%
c6
B
&
6 (
V'
)
g6
2
D
1
L'b
)
2 @
E$
%
&
@ A 6
)
6
%
c 6B
& 6 (V
'
)
g6
@
EE
EE
EE
"
#
-
8/6/2019 VP Prefinal Project Docu.
15/39
G
H
E I s P QR
bQr
S
hT U
y=
S P VS
P W bP r H X S
Y
Y cS
Y bP r H H
Q
R
bQ rS
hT U y
=s P VS
H X
Y r Ha
b c Y rY sc Y V P YR
LQ brU U d T
V Q rgY b
E I s P QR
bQ rS
hT U y= Y cS
Y bP r
H G S
Y H H
b c Y rY sc Y V P YR
LQ brU U d T
ScYr
V Q Y b
E I s P
b c Y rY sc Y V P
Y
R
LQ brU b
ee
ee
ee
E I s P QR
bQ rS
hT U y=
f cS
Y b P r H X S
Y
d Y vP W bP r
H G
Q
R
bQ rS
hT U y
= Y cS
Y bP r H X
Y r Ha
b c Y rY sc Y V P YR
LQ brU U d T
Sc Y rV Q Y b
E I s P QR
bQ rS
hT U y=NY v
H g Y r H G
b c Y rY sc Y V P YR
ScYr
V Q Y
U d T
S U gQS S
U rQ h s b
E I s P
b c Y rY sc Y V P
Y
R
ScY
rV Q Y
b
ee
ee
ee
G H
-
8/6/2019 VP Prefinal Project Docu.
16/39
i
p
q
r
s
t
u
v
w u x
y
t
w
t
x p p y
t t
w
t
x
p i
u
v
w u x
y
p p
x
p
x
s
t
v
u
y y
x u s
s
x
u
q
r
s
t
u
v
w u x
y
t
p
y
p i
x
s
t
v
u
y y
x u s
x u
x
q
r
s
t
x
s
t
v
u
y y
x u s
q
r
s
t
u
v
w u x
y
t t
w
t
x
p p
y
x
i
u
v
w u x
y
t t
w
t
x
p p
x
p
x
s
t
v
x u
x
u
y y
x u s
q
r
s
t
u
v
w u x
y
J
i
x
i
x
s
t
v
q x u s
x u
x
q
r
s
t
x
s
t
v
x u
x
i p
-
8/6/2019 VP Prefinal Project Docu.
17/39
j
k
l
m n
o
bo
r
h
=
r
j
n
br
r
z
{{
o
bo
r
h
=|
} j
rj
{{
"~
r m n
A
ro
m
ro
r
"
k
l
m n
o
bo
r
h
=
n
b}
z
{{
" ~
r m n
A
ro
m
P
o
m n m
"
k
l
m n
"~
r m n
A
ro
m
"
k
l
m n
o
bo
r
h
=
n
br
r
r
h
j
{{
o
bo
r
h
=
n
b}
rj
{{
"~
r m n
Po
m n m
A
ro
m
"
k
l
m n
o
bo
r
h
=
r
h}
rj
{{
"~
r m n
Po
m n m
Aro
n m
"
k
l
m n
"~
r m n
Po
m n m
"
-
8/6/2019 VP Prefinal Project Docu.
18/39
______________________________________________________________________
VP_9_ Callcost
PublicClass CallCostPrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.ClicktxtCallLength.Text = ""txtCallStart.Text = ""txtday.Text = ""txtAnswer.Text = ""
EndSubPrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.ClickMe.Close()
EndSubPrivateSub btnOK_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOK.ClickDim DAYZ AsString = txtday.Text.ToUpperDim CALLS AsDate = txtCallStart.TextCALLS = CALLS.ToShortTimeStringIf DAYZ = "MO"Or DAYZ = "TU"Or DAYZ = "WE"Or DAYZ = "TH"Or DAYZ =
"FR"Or DAYZ = "MONDAY"Or DAYZ = "TUESDAY"Or DAYZ = "WEDNESDAY"Or DAYZ ="THURSDAY"Or DAYZ = "FRIDAY"Or DAYZ = "MON"Or DAYZ = "TUE"Or DAYZ = "WED"Or DAYZ = "THU"Or DAYZ = "FRI"Then
SelectCase CALLSCase #8:00:00 AM# To #6:00:00 PM#
txtAnswer.Text = "$ " & CInt(txtCallLength.Text) * 0.5CaseElse
txtAnswer.Text = "$ " & CInt(txtCallLength.Text) * 0.4EndSelect
ElseIf DAYZ = "SA"Or DAYZ = "SU"Or DAYZ = "SAT"Or DAYZ = "SUN"OrDAYZ = "SATURDAY"Or DAYZ = "SUNDAY"Then
txtAnswer.Text = "$ " & CInt(txtCallLength.Text) * 0.25EndIf
EndSubEndClass
-
8/6/2019 VP Prefinal Project Docu.
19/39
PseudoCode/Flowchart:
The user will input day of the week, call started and Calllength.
Ifthe inputted day ofthe week isatthe range of Monday toFriday, and if itstime is
from 8 am to6 pm
itwilldisplay the call
costwhich isthe call
lengthmultiplied to
0.50, else itwill
display the callcost
which isthe calllengthmultiplied to
0.40.
Elseif the inputted
day ofthe week isat
the range of
Saturday toSunday,
itwilldisplay the call
costwhich isthe call
lengthmultipliedto0.25.
,
M
*
*
*
-
8/6/2019 VP Prefinal Project Docu.
20/39
______________________________________________________________________
VP_2_ PRICE YEARS
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) HandlesMyBase.Load
Dim Price, Years, Salvage, Depreciation AsDoublePrice = InputBox("Enter the purchase price of the item.", "Provide a value")Years = InputBox("Enter expected number of years in service.", "Provide a
value")Salvage = InputBox("Enter the expected salvage value.", "Provide a value")Depreciation = (Price - Salvage) / YearsMessageBox.Show("The yearly depreciation for the item is" & " " &
Depreciation, "RESULT")
Me.Close()EndSub
EndClassPseudocode:
Enter purchase price of the item, expected number ofyears in service and the salvage value.
A formula will be generated.
Depreciation = (Purchase price Salvage) / years in
service
Then display Depreciation.
-
8/6/2019 VP Prefinal Project Docu.
21/39
______________________________________________________________________
VP_5_ Even
PublicClass Form1PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOK.ClickDim INPUT AsInteger = txtinput.TextDim NUMINPUT AsIntegerDim INTCOUNT AsInteger = txtinput.TextINPUT = INPUTNUMINPUT = CInt(INPUT)INTCOUNT = 1If txtinput.Text >= 1 And txtinput.Text < 21 Then
DoUntil INTCOUNT > NUMINPUTINPUT = InputBox("Enter the value " & INTCOUNT.ToString,
"Find the Even")
INTCOUNT = INTCOUNT + 1lstvalues.Items.Add("Value " & INTCOUNT - 1 & ": " & INPUT)If INPUT Mod 2 = 0 Then
lsteven.Items.Add(INPUT)EndIf
LoopIf lsteven.Items.Count = 0 Then
lsteven.Items.Add("None")MessageBox.Show("No Even number", "None")
EndIfElse
MessageBox.Show("1 to 20 only", "Enter valid Input")txtinput.Text = ""
EndIf
EndSubPrivateSub btclear_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btclear.Clicklsteven.Items.Clear()lstvalues.Items.Clear()txtinput.Text = ""
EndSubEndClass
-
8/6/2019 VP Prefinal Project Docu.
22/39
Start
Input Number
of value.
If Input >= 1
and
-
8/6/2019 VP Prefinal Project Docu.
23/39
-
8/6/2019 VP Prefinal Project Docu.
24/39
______________________________________________________________________
VP_6_ Roman
PublicClass Roman
PrivateSub btnClose_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnClose.Click
Me.Close()
EndSub
PrivateSub btnOK_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnOK.Click
Dim INPUT AsInteger = txtnum.TextDim ONES() AsString = {"I", "II", "III", "IV", "V", "VI", "VII",
"VIII", "IX"}
Dim TENS() AsString = {"X", "XX", "XXX", "XL", "L", "LX", "LXX","LXXX", "XC"}Dim HUNDREDS() = {"C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC",
"CM"}Dim THOUSANDS() = {"M", "MM", "MMM"}Dim ONE AsIntegerDim TEN AsIntegerDim HUNDRED AsIntegerDim THOU AsIntegerDim ROMAN AsStringIf INPUT < 1 Then
MessageBox.Show("Positive Numbers only", "Invalid Input")ElseIf INPUT < 10 Then
ONE = INPUT Mod 10
SelectCase ONECase 1
ROMAN = ONES(0)Case 2
ROMAN = ONES(1)Case 3
ROMAN = ONES(2)Case 4
ROMAN = ONES(3)Case 5
ROMAN = ONES(4)Case 6
ROMAN = ONES(5)
Case 7ROMAN = ONES(6)Case 8
ROMAN = ONES(7)Case 9
ROMAN = ONES(8)EndSelecttxtinNumber.Text = INPUTtxtinRoman.Text = ROMAN
ElseIf INPUT >= 10 And INPUT < 100 Then
-
8/6/2019 VP Prefinal Project Docu.
25/39
ONE = INPUT Mod 10SelectCase ONE
Case 1ROMAN = ONES(0)
Case 2ROMAN = ONES(1)
Case 3ROMAN = ONES(2)
Case 4ROMAN = ONES(3)
Case 5ROMAN = ONES(4)
Case 6ROMAN = ONES(5)
Case 7ROMAN = ONES(6)
Case 8ROMAN = ONES(7)
Case 9ROMAN = ONES(8)
EndSelectINPUT -= ONETEN = INPUT Mod 100SelectCase TEN / 10
Case 1ROMAN = TENS(0) & ROMAN
Case 2ROMAN = TENS(1) & ROMAN
Case 3ROMAN = TENS(2) & ROMAN
Case 4ROMAN = TENS(3) & ROMAN
Case 5ROMAN = TENS(4) & ROMAN
Case 6ROMAN = TENS(5) & ROMAN
Case 7ROMAN = TENS(6) & ROMAN
Case 8ROMAN = TENS(7) & ROMAN
Case 9ROMAN = TENS(8) & ROMAN
EndSelecttxtinNumber.Text = ONE + TENtxtinRoman.Text = ROMAN
ElseIf INPUT >= 100 And INPUT < 1000 ThenONE = INPUT Mod 10
SelectCase ONECase 1
ROMAN = ONES(0)Case 2
ROMAN = ONES(1)Case 3
ROMAN = ONES(2)Case 4
ROMAN = ONES(3)Case 5
-
8/6/2019 VP Prefinal Project Docu.
26/39
ROMAN = ONES(4)Case 6
ROMAN = ONES(5)Case 7
ROMAN = ONES(6)Case 8
ROMAN = ONES(7)Case 9
ROMAN = ONES(8)EndSelectINPUT -= ONETEN = INPUT Mod 100SelectCase TEN / 10
Case 1ROMAN = TENS(0) & ROMAN
Case 2ROMAN = TENS(1) & ROMAN
Case 3ROMAN = TENS(2) & ROMAN
Case 4
ROMAN = TENS(3) & ROMANCase 5
ROMAN = TENS(4) & ROMANCase 6
ROMAN = TENS(5) & ROMANCase 7
ROMAN = TENS(6) & ROMANCase 8
ROMAN = TENS(7) & ROMANCase 9
ROMAN = TENS(8) & ROMANEndSelectINPUT -= TENHUNDRED = INPUT Mod 1000SelectCase HUNDRED / 100
Case 1ROMAN = HUNDREDS(0) & ROMAN
Case 2ROMAN = HUNDREDS(1) & ROMAN
Case 3ROMAN = HUNDREDS(2) & ROMAN
Case 4ROMAN = HUNDREDS(3) & ROMAN
Case 5ROMAN = HUNDREDS(4) & ROMAN
Case 6ROMAN = HUNDREDS(5) & ROMAN
Case 7ROMAN = HUNDREDS(6) & ROMAN
Case 8ROMAN = HUNDREDS(7) & ROMAN
Case 9ROMAN = HUNDREDS(8) & ROMAN
EndSelecttxtinNumber.Text = ONE + TEN + HUNDREDtxtinRoman.Text = ROMAN
ElseIf INPUT >= 1000 And INPUT < 4000 Then
-
8/6/2019 VP Prefinal Project Docu.
27/39
ONE = INPUT Mod 10SelectCase ONE
Case 1ROMAN = ONES(0)
Case 2ROMAN = ONES(1)
Case 3ROMAN = ONES(2)
Case 4ROMAN = ONES(3)
Case 5ROMAN = ONES(4)
Case 6ROMAN = ONES(5)
Case 7ROMAN = ONES(6)
Case 8ROMAN = ONES(7)
Case 9ROMAN = ONES(8)
EndSelectINPUT -= ONETEN = INPUT Mod 100SelectCase TEN / 10
Case 1ROMAN = TENS(0) & ROMAN
Case 2ROMAN = TENS(1) & ROMAN
Case 3ROMAN = TENS(2) & ROMAN
Case 4ROMAN = TENS(3) & ROMAN
Case 5ROMAN = TENS(4) & ROMAN
Case 6ROMAN = TENS(5) & ROMAN
Case 7ROMAN = TENS(6) & ROMAN
Case 8ROMAN = TENS(7) & ROMAN
Case 9ROMAN = TENS(8) & ROMAN
EndSelectINPUT -= TENHUNDRED = INPUT Mod 1000SelectCase HUNDRED / 100
Case 1
ROMAN = HUNDREDS(0) & ROMANCase 2
ROMAN = HUNDREDS(1) & ROMANCase 3
ROMAN = HUNDREDS(2) & ROMANCase 4
ROMAN = HUNDREDS(3) & ROMANCase 5
ROMAN = HUNDREDS(4) & ROMANCase 6
-
8/6/2019 VP Prefinal Project Docu.
28/39
ROMAN = HUNDREDS(5) & ROMANCase 7
ROMAN = HUNDREDS(6) & ROMANCase 8
ROMAN = HUNDREDS(7) & ROMANCase 9
ROMAN = HUNDREDS(8) & ROMANEndSelecttxtinNumber.Text = ONE + TEN + HUNDREDtxtinRoman.Text = ROMANINPUT -= HUNDREDTHOU = INPUT Mod 10000SelectCase THOU / 1000
CaseIs = 1ROMAN = THOUSANDS(0) & ROMAN
CaseIs = 2ROMAN = THOUSANDS(1) & ROMAN
CaseIs = 3ROMAN = THOUSANDS(2) & ROMAN
EndSelect
txtinNumber.Text = ONE + TEN + HUNDRED + THOUtxtinRoman.Text = ROMAN
ElseMessageBox.Show("1 to 3999 only.", "Out of Range")txtinNumber.Text = ""txtinRoman.Text = ""txtnum.Text = ""
EndIfEndSub
PrivateSub btnClear_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnClear.Click
txtinNumber.Text = ""txtinRoman.Text = ""txtnum.Text = ""
EndSubEndClass
-
8/6/2019 VP Prefinal Project Docu.
29/39
Start
Input Number
If
Number < 1TT
FF
Positive
Numbers Only
Elseif
Number >= 1
And 9
and < 100
TTRoman = Number
mod 10
Roman = (Number
mod 100) / 10
Print RomanFF
Elseif
Number > 99
And < 1000
TTRoman = Number
mod 10
Roman = (Number
mod 100) / 10
Print Roman
Roman = (Number
mod 1000) / 100
FF
Elseif
Number > 999
And < 4000
TTRoman = Number
mod 10
Roman = (Number
mod 100) / 10
Print Roman
Roman = (Number
mod 1000) / 100
Roman = (Number
mod 10000) / 1000
Else
FF
1 to 3999 only
Stop
Pseudocode/Flowchart:
The userwill inputthe number.
Ifthe number is lessthan to1 itwilldisplay Positive Numbersonly.
Elseifthe number islessthan to10 itwilldisplay the answerwhen itmoduloby 10.
Elseifthe number isgreaterthan 9 andlessthan to100 itwilldisplay the answerbymoduloof it firstby 10 andby 100 anddividing itby 10
Elseifthe number isgreaterthan 99 andlessthan to1000 itwilldisplay the answerbymoduloof it firstby 10 , 100 anddividing itby 10 andlast1000 anddividing by 100.
Elseif the number isgreaterthan 999 andlessthan 4000 itwilldisplay the answerbymoduloof it firstby 10 , 100 anddividing itby 10 and1000 100 andlast ismodulo itby 10000 anddivide by 1000.
Else, itwilldisplay 1 to3999 only.
-
8/6/2019 VP Prefinal Project Docu.
30/39
______________________________________________________________________
VP_3_ Paycode
PublicClass Form1
PrivateSub btnOK_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnOK.Click
Dim CHCODE AsString = txtinput.TextDim NAME AsStringSelectCase CHCODE
Case 1NAME = InputBox("Enter your Name:", "Employees Name")txtpay.Text = "Employees Name: " & NAME & vbNewLine &
"Employees Type:Manager" & vbNewLine & "Weekly Salary:" & "$ " & "6,000"
Case 2Dim HOURLYWAGE AsDouble = 30Dim HOURS AsDoubleNAME = InputBox("Enter your Name:", "Employees Name")HOURS = InputBox("How Many Hours you Worked:", "Number of
Hours Worked")If HOURS = 40 Then
txtpay.Text = "Employees Name: " & NAME & vbNewLine &"Employees Type: Hourly Worker" & vbNewLine & "Hourlywage: $ 30" & vbNewLine& "Number of Hours Worked:" & HOURS & vbNewLine & "Overtime: None" &vbNewLine & "Pay: $ " & (HOURS * HOURLYWAGE)
ElseIf HOURS > 40 ThenDim OT AsInteger
OT = HOURS - 40txtpay.Text = "Employees Name: " & NAME & vbNewLine &"Employees Type: Hourly Worker" & vbNewLine & "Hourlywage: $ 30" & vbNewLine& "Overtime Hourlywage: $ 45" & vbNewLine & "Number of Hours Worked: " &HOURS & " hrs." & vbNewLine & "Overtime: " & OT & " hrs." & vbNewLine & "Pay:$ " & ((HOURS - 40) * 45) + 1200
ElseMessageBox.Show("You need to work atleast 40 hours",
"Incomplete")EndIf
Case 3Dim GWSALE AsDoubleNAME = InputBox("Enter your Name:", "Employees Name")GWSALE = InputBox("Enter your Gross Weekly Sale:", "Gross
Weekly Sale")Dim percent AsInteger = (GWSALE * 0.057)txtpay.Text = "Employees Name: " & NAME & vbNewLine & "Type:
Commission Worker" & vbNewLine & "Fixed Amount to receive: $ 250" & vbNewLine& "Gross Weekly Sale:" & "$ " & GWSALE & vbNewLine & "Commission: " & percent& vbNewLine & "Pay: $ " & ((GWSALE * 0.057) + 250)
Case 4Dim IPRICE AsDoubleDim PERITEM AsDouble = 25NAME = InputBox("Enter your Name:")
-
8/6/2019 VP Prefinal Project Docu.
31/39
IPRICE = InputBox("How many items did you produced?", "Itemsyou Produced")
txtpay.Text = "Employees Name: " & NAME & vbNewLine &"Employees Type: Pieceworker" & vbNewLine & "Amount received per item: $ 25"
& vbNewLine & "Items Produced: " & IPRICE & vbNewLine & "Pay: $ " & IPRICE *PERITEM
CaseElseMessageBox.Show("Enter a Valid Code " & vbNewLine & "1 to 4
Only", "Wrong code")EndSelect
EndSub
PrivateSub btnExit_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnExit.Click
Close()EndSub
PrivateSub btnclear_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnclear.Clicktxtinput.Text = ""txtpay.Text = ""
EndSubEndClass
-
8/6/2019 VP Prefinal Project Docu.
32/39
Pseudocode/Flowchart:
Userwill inputacode. Enteredcode will fall into itsappropriate case
Case 1
Prompt forName
Then display
Manager: & Name
Weekly salary: & $6000
Case 2
Prompt input forname, andhowmany hoursofworked
If Hoursofworked= 40 thenDisplay
Hourly worker: & Name
Pay: & hoursofworked*30
Else if Hoursofworked> 40 then
Display
Hourly worker: & Name
Pay: & (hoursofworked -40)*45+1200
Else
Display
Youneedtowork atlest40 hours
End if
Case 3
Prompt input forname, andGrossWeekly Sale
Then display
Commission Worker: & name
-
8/6/2019 VP Prefinal Project Docu.
33/39
Pay: & (Gross Weekly Sale * 0.057) + 250
Case 4
Prompt input for name, and number of items produced
Then display
Piece worker: & name
Pay: & number of items produced *25
Case else
Display Enter a Code of range 1 to 4 only
End select
-
8/6/2019 VP Prefinal Project Docu.
34/39
______________________________________________________________________
VP_10_ Histogram
Dim Alpha(0 To 25) AsIntegerDim Asterisk(0 To 25) AsString
Dim N AsInteger
For N = 1 To Len(txtIN.Text)
SelectCase UCase(Mid(txtIN.Text, N, 1))
Case"A"Alpha(0) = Alpha(0) + 1Asterisk(0) += "*"
Case"B"Alpha(1) = Alpha(1) + 1Asterisk(1) += "*"
Case"C"Alpha(2) = Alpha(2) + 1Asterisk(2) += "*"
Case"D"Alpha(3) = Alpha(3) + 1Asterisk(3) += "*"
Case"E"Alpha(4) = Alpha(4) + 1Asterisk(4) += "*"
Case"F"Alpha(5) = Alpha(5) + 1Asterisk(5) += "*"
Case"G"Alpha(6) = Alpha(6) + 1
Asterisk(6) += "*"Case"H"
Alpha(7) = Alpha(7) + 1Asterisk(7) += "*"
Case"I"Alpha(8) = Alpha(8) + 1Asterisk(8) += "*"
Case"J"Alpha(9) = Alpha(9) + 1Asterisk(9) += "*"
Case"K"Alpha(10) = Alpha(10) + 1Asterisk(10) += "*"
Case"L"Alpha(11) = Alpha(11) + 1Asterisk(11) += "*"
Case"M"Alpha(12) = Alpha(12) + 1Asterisk(12) += "*"
Case"N"Alpha(13) = Alpha(13) + 1Asterisk(13) += "*"
Case"O"
-
8/6/2019 VP Prefinal Project Docu.
35/39
Alpha(14) = Alpha(14) + 1Asterisk(14) += "*"
Case"P"Alpha(15) = Alpha(15) + 1Asterisk(15) += "*"
Case"Q"Alpha(16) = Alpha(16) + 1Asterisk(16) += "*"
Case"R"Alpha(17) = Alpha(17) + 1Asterisk(17) += "*"
Case"S"Alpha(18) = Alpha(18) + 1Asterisk(18) += "*"
Case"T"Alpha(19) = Alpha(19) + 1Asterisk(19) += "*"
Case"U"Alpha(20) = Alpha(20) + 1Asterisk(20) += "*"
Case"V"Alpha(21) = Alpha(21) + 1Asterisk(21) += "*"
Case"W"Alpha(22) = Alpha(22) + 1Asterisk(22) += "*"
Case"X"Alpha(23) = Alpha(23) + 1Asterisk(23) += "*"
Case"Y"Alpha(24) = Alpha(24) + 1Asterisk(24) += "*"
Case"Z"Alpha(25) = Alpha(25) + 1Asterisk(25) += "*"
EndSelect
Next
If Alpha(0) > 0 Then lstOUT.Items.Add("a " & " " & Asterisk(0))If Alpha(1) > 0 Then lstOUT.Items.Add("b " & " " & Asterisk(1))If Alpha(2) > 0 Then lstOUT.Items.Add("c " & " " & Asterisk(2))If Alpha(3) > 0 Then lstOUT.Items.Add("d " & " " & Asterisk(3))If Alpha(4) > 0 Then lstOUT.Items.Add("e " & " " & Asterisk(4))If Alpha(5) > 0 Then lstOUT.Items.Add("f " & " " & Asterisk(5))If Alpha(6) > 0 Then lstOUT.Items.Add("g " & " " & Asterisk(6))
If Alpha(7) > 0 Then lstOUT.Items.Add("h " & " " & Asterisk(7))If Alpha(8) > 0 Then lstOUT.Items.Add("i " & " " & Asterisk(8))If Alpha(9) > 0 Then lstOUT.Items.Add("j " & " " & Asterisk(9))If Alpha(10) > 0 Then lstOUT.Items.Add("k " & " " & Asterisk(10))If Alpha(11) > 0 Then lstOUT.Items.Add("l " & " " & Asterisk(11))If Alpha(12) > 0 Then lstOUT.Items.Add("m " & " " & Asterisk(12))If Alpha(13) > 0 Then lstOUT.Items.Add("n " & " " & Asterisk(13))If Alpha(14) > 0 Then lstOUT.Items.Add("o " & " " & Asterisk(14))If Alpha(15) > 0 Then lstOUT.Items.Add("p " & " " & Asterisk(15))If Alpha(16) > 0 Then lstOUT.Items.Add("q " & " " & Asterisk(16))
-
8/6/2019 VP Prefinal Project Docu.
36/39
If Alpha(17) > 0 Then lstOUT.Items.Add("r " & " " & Asterisk(17))If Alpha(18) > 0 Then lstOUT.Items.Add("s " & " " & Asterisk(18))If Alpha(19) > 0 Then lstOUT.Items.Add("t " & " " & Asterisk(19))If Alpha(20) > 0 Then lstOUT.Items.Add("u " & " " & Asterisk(20))If Alpha(21) > 0 Then lstOUT.Items.Add("v " & " " & Asterisk(21))If Alpha(22) > 0 Then lstOUT.Items.Add("w " & " " & Asterisk(22))If Alpha(23) > 0 Then lstOUT.Items.Add("x " & " " & Asterisk(23))If Alpha(24) > 0 Then lstOUT.Items.Add("y " & " " & Asterisk(24))If Alpha(25) > 0 Then lstOUT.Items.Add("z " & " " & Asterisk(25))EndSub
-
8/6/2019 VP Prefinal Project Docu.
37/39
Algorithm/Flowchart:
Enterastring.
The programwillread theentered text.
The programwilldetermine the lengthofthe string.
Aloop thatreads everyindividualletters on thestringnomatterits anuppercase orlowercasethen display eachletters
frequency by asterisk willbe created.
The loop willstop untiltheend ofthe stringwasread.
-
8/6/2019 VP Prefinal Project Docu.
38/39
______________________________________________________________________
VP_4_ Box
PublicClass Form1
PrivateSub Button11_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button11.Click
Dim SPL() AsStringDim OUTPUT AsStringDim SPACE, MID AsStringDim WID AsIntegerDim HEI AsIntegerDim WIDTH AsStringDim HEIGHT AsString
SPL = Split(txtheiwid.Text, " ")WIDTH = SPL(1)HEIGHT = SPL(0)SPACE = SPACEFor WID = 1 ToCInt(WIDTH)
OUTPUT &= "*"
Next
For WID = 0 ToCInt(WIDTH - 2) * 2SPACE &= " "
NextFor HEI = 3 ToCInt(HEIGHT)
MID &= vbCrLf & "*" & SPACE & "*"Next
MID &= vbCrLf
MessageBox.Show(OUTPUT & MID & OUTPUT)Dim ANOTHER AsStringANOTHER = MessageBox.Show("Another?", "One more",
MessageBoxButtons.YesNo)If ANOTHER = vbYes Then
Me.Show()txtheiwid.Text = ""
ElseMe.Close()
EndIf
EndSubEndClass
-
8/6/2019 VP Prefinal Project Docu.
39/39
Pseudocode/Algorithm:
The userwillinputthe heightandwidth.
The firstnumberisthe Height.
The Secondnumberisthe width.
The programwillOutputthe Inputtedheightandwidthlike a box andthe programwillpromptthe userifhe/she wantsanother?