I hope you guys can help me Im having troubles with this. I need to create this using Vb or vs2008 visual studio or visual basic 2008 can you guys help me?

INTERNET SERVICE PROVIDER

An internet service provicer offers 3 subscriptions packages to its customers, plus a discount for nonprofit organizations
a) packaga A: 10 hours of access for $9.95 per month. Additional hpurs are $2.00 per hour.
b)package B: 20 Hours of access for $14.95 per month. Additional hpurs are $1.00 per hpur
c)package C: Unlimited access for $19.95 per month
d)Nonprofit Organizations: the service provider gives all nonprofit prganizations 20% discount on all packages
the user should selelct the package the customer has purchased(from a set of radio buttons) and enter the number of hpurs used> a check box captioned nonprofit organization should also appear on the form. the application should calculateand display the total amount due. if user selects the nonprofit organization chek box a 20
% discount should be deducted from the final charges. implementation note: all rates, and discounts must be declared using simbolic constats(using the keyboard const)
input validation": the number if hpours used in a month cannot excees 744.. the value must be numeric

try it on your own ...figure out whatever you can and then ask for help...

we aint gonna solve your homework for you just like that...

[QUOTE=milonsito;705357]I hope you guys can help me Im having troubles with this. I need to create this using Vb or vs2008 visual studio or visual basic 2008 can you guys help me?

INTERNET SERVICE PROVIDER

An internet service provicer offers 3 subscriptions packages to its customers, plus a discount for nonprofit organizations
a) packaga A: 10 hours of access for $9.95 per month. Additional hpurs are $2.00 per hour.
b)package B: 20 Hours of access for $14.95 per month. Additional hpurs are $1.00 per hpur
c)package C: Unlimited access for $19.95 per month
d)Nonprofit Organizations: the service provider gives all nonprofit prganizations 20% discount on all packages
the user should selelct the package the customer has purchased(from a set of radio buttons) and enter the number of hpurs used> a check box captioned nonprofit organization should also appear on the form. the application should calculateand display the total amount due. if user selects the nonprofit organization chek box a 20
% discount should be deducted from the final charges. implementation note: all rates, and discounts must be declared using simbolic constats(using the keyboard const)
input validation": the number if hpours used in a month cannot excees 744.. the value must be numeric[/QUOTE]

this is what i have so far

Public Class Form1

    Const decDiscount As Decimal = 0.2D

    Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click

        'Declare the variables
        Dim decBaseFee As Decimal
        Dim decDiscount As Decimal
        Dim decTotalFee As Decimal
        Dim intHoursUsed As Integer

        'check the number of months and exit if it contains invalid data
        If Not Integer.TryParse(txtHoursUsed.Text, intHoursUsed) Then
            MessageBox.Show("Months Must be a Valid Integer", "Input Error")
            Return

        End If

        'chekc the month range must be 1-24.

        If (intHoursUsed < 1) Or (intHoursUsed > 744) Then
            MessageBox.Show("Months must be a valid integer", "Inpuy Error")
            Return
        End If

        'if we reach this point, we assume the input data is valid.
        'calculate the base monthly fee.

        If radPackageA.Checked = True Then
            decBaseFee = 9.95
        ElseIf radPackageB.Checked = True Then
            decBaseFee = 14.95
        ElseIf radPackageB.Checked = True Then
        ElseIf intHoursUsed >= 20 Then
            decTotalFee = decBaseFee + txtHoursUsed.Text * 2


        ElseIf radPackageC.Checked = True Then
            decBaseFee = 19.95


        End If

        'looK for additional services
        If chkNonprofit.Checked = True Then
            decTotalFee = decBaseFee * 20 / 100 - decBaseFee
            If chkNonprofit.Checked = False Then
                decBaseFee -= decDiscount
            End If



        End If


        'dETERMINE THE DISCOUNT, Bsed on membership Hours.
        Select Case txtHoursUsed.Text
            Case Is <= 10
                decTotalFee = decBaseFee * 20 / 100 - decBaseFee
            Case Is >= 10
                decTotalFee = decBaseFee + txtHoursUsed.Text - decBaseFee



        End Select
        'Adjust the discount, calculate total fee
        decBaseFee -= decDiscount





        'display the fees
        txtAmountDue.Text = decTotalFee.ToString("c")
        txtFinalCharge.Text = decBaseFee.ToString("c")

    End Sub


    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        radPackageA.Checked = True
        chkNonprofit.Checked = False
        txtHoursUsed.Clear()
        txtAmountDue.Text = String.Empty
        txtFinalCharge.Text = String.Empty
    End Sub

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
        Me.close
    End Sub
End Class

Edited 3 Years Ago by Reverend Jim: Fixed formatting

this is what i have so far

Public Class Form1

    Const decDiscount As Decimal = 0.2D

    Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click

        'Declare the variables
        Dim decBaseFee As Decimal
        Dim decDiscount As Decimal
        Dim decTotalFee As Decimal
        Dim intHoursUsed As Integer

        'check the number of months and exit if it contains invalid data
        If Not Integer.TryParse(txtHoursUsed.Text, intHoursUsed) Then
            MessageBox.Show("Months Must be a Valid Integer", "Input Error")
            Return

        End If

        'chekc the month range must be 1-24.

        If (intHoursUsed < 1) Or (intHoursUsed > 744) Then
            MessageBox.Show("Months must be a valid integer", "Inpuy Error")
            Return
        End If

        'if we reach this point, we assume the input data is valid.
        'calculate the base monthly fee.

        If radPackageA.Checked = True Then
            decBaseFee = 9.95
        ElseIf radPackageB.Checked = True Then
            decBaseFee = 14.95
        ElseIf radPackageB.Checked = True Then
        ElseIf intHoursUsed >= 20 Then
            decTotalFee = decBaseFee + txtHoursUsed.Text * 2


        ElseIf radPackageC.Checked = True Then
            decBaseFee = 19.95


        End If

        'looK for additional services
        If chkNonprofit.Checked = True Then
            decTotalFee = decBaseFee * 20 / 100 - decBaseFee
            If chkNonprofit.Checked = False Then
                decBaseFee -= decDiscount
            End If



        End If


        'dETERMINE THE DISCOUNT, Bsed on membership Hours.
        Select Case txtHoursUsed.Text
            Case Is <= 10
                decTotalFee = decBaseFee * 20 / 100 - decBaseFee
            Case Is >= 10
                decTotalFee = decBaseFee + txtHoursUsed.Text - decBaseFee



        End Select
        'Adjust the discount, calculate total fee
        decBaseFee -= decDiscount





        'display the fees
        txtAmountDue.Text = decTotalFee.ToString("c")
        txtFinalCharge.Text = decBaseFee.ToString("c")

    End Sub


    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        radPackageA.Checked = True
        chkNonprofit.Checked = False
        txtHoursUsed.Clear()
        txtAmountDue.Text = String.Empty
        txtFinalCharge.Text = String.Empty
    End Sub

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
        Me.close
    End Sub

End Class

Edited 3 Years Ago by Reverend Jim: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.