创建运费计算器 [英] Creating a Shipping Charge Calculator

查看:88
本文介绍了创建运费计算器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位大家好。我是一个写VB代码的完整菜鸟。我在绘制表单时没有问题,但是在代码方面。我迷路了。

我有一个用户界面设计课,我们有一个小项目到期。我想知道是否有人能给我一些大帮助。

我们必须完成的项目如下:


快速货运公司收取费用如下表所示:

包裹重量(公斤) / 每英里运费

2kg或更少/ $ 0.01

超过2公斤,但不超过6公斤/0.015

超过6公斤,但不超过10公斤/0.020

超过10公斤,但不超过20公斤/0.025美元

创建一个应用程序,允许用户输入包裹的重量和运输距离,然后显示费用。


输入验证:对于包的重量,不接受0或更小的值。不要接受超过20公斤的重量(这是公司将发运的最大重量)不接受小于10英里或超过3000英里的距离。这些是公司的最小和最大运输距离。使用异常处理来检查非数字数据。



我要求别人写几乎我需要的代码使这个功能正常。在等待任何回复的时候,我会试着搞砸它。非常感谢advancne

解决方案

0.01

超过2公斤,但不超过6公斤/


0.015

超过6公斤,但不超过10公斤/


0.02

超过10公斤,但不超过20公斤/

Hello everybody. I am a complete noob in writing VB code. I don''t have a problem drawing a form, but when it comes to code. I am lost.
I have a user interface design class and we have a small project due. I was wondering if anyone could give me some mega help.
The project we have to complete is the following:

The Fast Freight Shipping Company charges the rates listed in the following table:

Weight of the Package (in kilograms) / Shipping rate per Mile
2kg or less / $0.01
over 2kg, but not more than 6kg /$0.015
over 6kg, but not more than 10kg /$0.02
over 10kg, but not more than 20kg / $0.025

Create an application that allows the user to enter the weight of the package and the distance it is to be shipped, and then displays the charges.

Input validation: Do not accept values of 0 or less for the weight of the package. Do not accept weights of more thann 20 kg(this is the maximum weight the company will ship) Do not accept distances of less than 10 miles or more than 3000 miles. These are the company''s minimum and maximum shipping distances. Use exception handling to check for non-numeric data.



I''m knd of asking for someone to pretty much write the code I would need to make this function properly. I will be trying to mess around with it while I wait for any response. Thanks very much in advancne

解决方案

0.01
over 2kg, but not more than 6kg /


0.015
over 6kg, but not more than 10kg /


0.02
over 10kg, but not more than 20kg /


这篇关于创建运费计算器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆