我想为停车的用户收取费用 [英] I want to make charge for the user for parking

查看:75
本文介绍了我想为停车的用户收取费用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做项目停车系统,我想要计算总金额意味着如果用户停车10分钟我想要收取10Rs。请问任何人如何在c#中计算感谢......在事先

I'm doing project car parking system in that i want to calculate total amount means if the user parks car for 10 minutes i want to make charge of 10Rs. Please can anyone how to calculate in c# Thank...... In Advance

推荐答案

首先,你需要找出时间和时间之间的区别时间以分钟计。然后将计算时间除以10并乘以10.
First Of all you need to find out difference between in-time and out-time in minutes. then divide calculated time with 10 and multiply with 10.


这是解决方案1的ac#版本。

Here is a c# version of solution 1.
public double ActualParkingFee(DateTime checkIn, DateTime checkOut)
{
    TimeSpan timeDiff = checkOut - checkIn;
    double fee = timeDiff.TotalMinutes;   // 1 RS / min, so no need for extra calculations
    return fee;
}


这篇关于我想为停车的用户收取费用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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