Visual Basic Programming and Algorithms

Total Length: 678 words ( 2 double-spaced pages)

Total Sources: 1

Page 1 of 2

Algorithms and Visual Basic Programming

Exercise

Algorithms

Output: gross pay

Input: hours worked

Algorithm:

enter number of hours worked if hours worked 0 ? 40, then calculate the gross pay ( hours *

display the gross pay otherwise, display an error message end if

If hours worked are not accept the new hour worked is between 40 and 60 hours

Display gross message

Otherwise display error message

Interface

Code

Public Class Form

Private Sub-Form1_Load (sender As Object, e As EventArgs) Handles MyBase.Load

calculates and displays gross pay

Const dblRATE As Double = 8.35

Dim dblHours As Double

Dim dblGross As Double

Double.TryParse (txtHours.Text, dblHours)

' calculate and display gross pay ' or display an error message

If dblHours >= 40 AndAlso dblHours
99 as the price end if

3. display the price

Interface

Code

Public Class Form1

' displays the price of a software package

Const dblULTIMATE As Double = 875.99

Const dblPROFESSIONAL As Double = 499.99

Const dblPROFESSIONAL As Double = 399.99

Const dblDISC_RATE As Double = 0.1

Dim dblPrice As Double

' determine price

If radUltimate.Checked = True Then

dblPrice = dblULTIMATE

If chkDiscount.Checked = True Then

Dim dblDiscount As Double

dblDiscount = dblPrice * dblDISC_RATE

dblPrice = dblPrice - dblDiscount

End If

Const dblDISC_RATE As Double = 0.2

Dim dblPrice As Double

' determine price

If radStudent.Checked = True Then

dblPrice = dblSTUDENT

If chkDiscount.Checked = True Then

Dim dblDiscount As Double

dblDiscount = dblPrice * dblDISC_RATE

dblPrice = dblPrice - dblDiscount

Else

dblPrice = dblPROFESSIONAL

End If

' display price lblPrice.Text = dblPrice.ToString ("C2")

End Sub

End Class

(Zak, 2013).

Chapter 10: Exercises 3

Output: fee

Input: code

Algorithms

If Code =S then fee= 40

If Code =F, then fee =50

If Code is S65, then fee =30

If Code….....

Show More ⇣


     Open the full completed essay and source list


OR

     Order a one-of-a-kind custom essay on this topic


sample essay writing service

Cite This Resource:

Latest APA Format (6th edition)

Copy Reference
"Visual Basic Programming And Algorithms" (2016, March 02) Retrieved May 8, 2025, from
https://www.aceyourpaper.com/essays/visual-basic-programming-algorithms-2161078

Latest MLA Format (8th edition)

Copy Reference
"Visual Basic Programming And Algorithms" 02 March 2016. Web.8 May. 2025. <
https://www.aceyourpaper.com/essays/visual-basic-programming-algorithms-2161078>

Latest Chicago Format (16th edition)

Copy Reference
"Visual Basic Programming And Algorithms", 02 March 2016, Accessed.8 May. 2025,
https://www.aceyourpaper.com/essays/visual-basic-programming-algorithms-2161078