473,516 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shipping program

2 New Member
Hello guys, I'm looking for help on writing this program. I need to calculate the shipping cost of an item depending on the wight the user inputs.

I have done the program as a console application already and it works, however, the assignment calls for a WPF and I'm not sure what else I need to do here.

This is what I have so far for the WPF

weight = user input
label 4 is the message being displayed

The code is only reading the first line in the if...elseif regardless of what I input on the weight text box on the form and I'm not really sure how I should go to fix that. Any help is appreciated.

Expand|Select|Wrap|Line Numbers
  1.  Dim price As Double
  2.  Dim weight As Double
  3.  
  4.  
  5.         If weight < 1 Then
  6.             price = 2.5
  7.         ElseIf weight >= 1 And weight < 5 Then
  8.             price = 10
  9.         ElseIf weight >= 5 And weight < 10 Then
  10.             price = 15
  11.         ElseIf weight = 10 Then
  12.             price = 16
  13.         End If
  14.  
  15.  
  16.  
  17.         label4.Text = ("The shipping cost will be $" & price)
  18.  
  19.  
Sep 26 '15 #1
2 1261
HIP318
2 New Member
If weight < 1 Then price = 2.5
If weight >= 1 And weight < 5 Then price = 10
If weight >= 5 And weight < 10 Then price = 15
If weight >= 10 Then price = 16
Sep 28 '15 #2
jinxzzz
2 New Member
Thanks for the reply, but the if...if else statements weren't the problem. I figured it out though. So again, thanks for the reply.
Sep 29 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5990
by: Tim Groulx | last post by:
Hello, I am setting up log shipping between two SQL servers. Everything in the setup seems to work fine. The problem I am having is that the "Log Shipping Alert Job - Backup" job is failing, event though the tlog backup copy & restore process is working fine. When I look at the histories of both the backup and copy/restore jobs, they are...
2
2135
by: Jennie | last post by:
I am going through a security audit on our servers. We use log shipping for a standby database. One of the questions in the audit has me looking for answers. "Are the transaction logs that are being shipped to the standby database encrypted?" I am assuming no. However, I need to know definitively. I have not been able to find an answer...
2
4082
by: nek | last post by:
Greetings, I tried to implement log shipping using PULL method as described in 'The Basics of DB2 Log Shipping' by Dale McInnis, but found the subsequent "rollforward" did not go beyond the first log. Here is what I did: 2 machines: Primary and standby servers both W2K SP4 running DB2 8.2. Both have logretain (YES) and USEREXIT (ON)...
51
5033
by: John Baker | last post by:
Hi: Some time ago I developed a program in Access, and separated the database and the program itself (using the normal access tools).We have the db on our server and the programin the desktop system. I have modified the program a number of times, and now find that I need to change the DB slightlt. This appears to require that I REMERGE the...
6
4611
by: Chris Buckett | last post by:
Hi, I was just wondering if anyone has had any experience in developing a shipping matrix. We are based in the UK, and we need to ship both locally and internationally. Local shipping is priced by weight and doesn't matter about the number of packages, international shipping is by weight and package size, so we need to know the number...
8
1379
by: chewie54 | last post by:
Hi All, I have read some posts on this subject but I haven't been able to make a decision whether to use Python or not. I'm considering converting a Java CAD program to Python/C with wxWdigets for the GUI. I don't have good answers for:
0
1409
by: Shalini Bhalla | last post by:
My zencart version is : v1.5.0 . I am trying to set shipping for my cart as follows : Goods to india : Rs.25/- as shipping ( including tax ) Goods aoutside India : Cost + 15% custom duty + Shipping I have used Zone Rates module . For India i have set Rs.25/- successfully but i am not able to solve For international . I want to add 15%...
0
7182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7142
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7548
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5714
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4773
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3267
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.