Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7533381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:42:36+00:00 2026-05-30T05:42:36+00:00

I’m working on an assignment where the program needs to calculate and display the

  • 0

I’m working on an assignment where the program needs to calculate and display the total cost for shipping a package, based on weight and whether it is being shipped to Continental U.S., Alaska, or Hawaii. When I click the Calculate button, though, the label that is supposed to display the total is left blank. I’ve looked through this and tried placing the calculation in different parts/at the end of the “If” statements. Here’s what I have thus far, any help would be appreciated:

Dim decWeight As Decimal
Dim decTotalCost As Decimal
Dim decDestination As Decimal
Dim decRate As Decimal

If IsNumeric(txtWeight.Text) Then

    decWeight = Convert.ToDecimal(txtWeight.Text)


    If decWeight <= 30 > 0 Then

        If radContinental.Checked Then
            decDestination = 1
        ElseIf radHawaii.Checked Then
            decDestination = 1.2
        ElseIf radAlaska.Checked Then
            decDestination = 1.26
        End If

        If decWeight <= 2 Then
            decRate = 3.69
        ElseIf decWeight <= 4 > 2 Then
            decRate = 4.86
        ElseIf decWeight <= 6 > 4 Then
            decRate = 5.63
        ElseIf decWeight <= 8 > 6 Then
            decRate = 5.98
        ElseIf decWeight <= 10 > 8 Then
            decRate = 6.28
        ElseIf decWeight <= 30 > 10 Then
            decRate = 15.72
        End If

        decTotalCost = decRate * decDestination
        lblTotalCost.Text = decTotalCost.ToString("C")

    ElseIf decWeight <= 0 Then
        MsgBox("Please Enter a Positive Weight.", , "Input Error")
    ElseIf decWeight > 30 Then
        MsgBox("You Have Entered " & decWeight.ToString() & ". Please Enter a Weight Under 30 Pounds", , "Input Error")
    End If


ElseIf txtWeight.Text = "" Then
    MsgBox("Please Enter the Weight", , "Input Error")

Else : MsgBox("Please Enter a Number", , "Input Error")
End If
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:42:37+00:00Added an answer on May 30, 2026 at 5:42 am

    You should try this if statement: If decWeight <= 30 and decWeight > 0 Then

    This will check if the decWeight is less than or equal to 30 and make sure that it is ‘non-zero’ Hope this helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
i want to parse a xhtml file and display in UITableView. what is the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
In my XML file chapters tag has more chapter tag.i need to display chapters
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.