C#函数用于计算剩余余额. [英] C# function for calculating exceeding balance.

查看:115
本文介绍了C#函数用于计算剩余余额.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我需要一个不返回负值的函数的帮助.例如,如果用户的帐户中有$ 100,并且想将$ 200转移到另一个帐户
输出消息应显示为余额不足".

Hey, I need help in a function that does not return negative values. For example, if user has $100 in his account and wants to transfer $200 to another account
an output message should read "Insufficient balance".

推荐答案

100并希望将


200转移到另一个帐户
输出消息应显示余额不足".
200 to another account
an output message should read "Insufficient balance".


Void DoTransfer(decimal Balance, decimal AmountTransfer)
{
if (AmountTransfer>Balance)
//Display ur msgbox here
else
{

//continue with your transactiosn
]


这篇关于C#函数用于计算剩余余额.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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