G
Guest
hi guys..
may i know how to get the bool compatible with float?? this is what I do
when the user checked the selected check box..
using System;
namespace CallBillingSystem
{
public class phoneRate
{
public int call_start; //in 24 hour notation
public int call_end; //in 24 hour notation
public int start_time; //in seconds
public int end_time; //in seconds
public float call_cost;
public int block_size;
public float rate_per_block;
public float Discount;
public float tax;
public float surcharge;
public phoneRate()
{
}
public void ConvertToBlocks ()
{
start_time = Math.round (((call_start/100) *60*60);
end_time = Math.round (((call_end/100) * 60)*60);
}
public void chargeForBillingPeriod ()
{
if (chkdiscountGiven.Checked==true)
{
call_cost = (call_cost + (((start_time - end_time)/block_size) *
rate_per_block))*Discount;
}
else if (chktaxGiven.Checked==true)
{
call_cost = (call_cost + (((start_time - end_time)/block_size) *
rate_per_block))*tax;
}
else if (chksurchargeGiven.Checked==true ())
{
call_cost = (call_cost + (((start_time - end_time)/block_size) *
rate_per_block))*surcharge;
}
else
{
call_cost = call_cost + (((start_time - end_time)/block_size) *
rate_per_block);
}
}
}
}
may i know how to get the bool compatible with float?? this is what I do
when the user checked the selected check box..
using System;
namespace CallBillingSystem
{
public class phoneRate
{
public int call_start; //in 24 hour notation
public int call_end; //in 24 hour notation
public int start_time; //in seconds
public int end_time; //in seconds
public float call_cost;
public int block_size;
public float rate_per_block;
public float Discount;
public float tax;
public float surcharge;
public phoneRate()
{
}
public void ConvertToBlocks ()
{
start_time = Math.round (((call_start/100) *60*60);
end_time = Math.round (((call_end/100) * 60)*60);
}
public void chargeForBillingPeriod ()
{
if (chkdiscountGiven.Checked==true)
{
call_cost = (call_cost + (((start_time - end_time)/block_size) *
rate_per_block))*Discount;
}
else if (chktaxGiven.Checked==true)
{
call_cost = (call_cost + (((start_time - end_time)/block_size) *
rate_per_block))*tax;
}
else if (chksurchargeGiven.Checked==true ())
{
call_cost = (call_cost + (((start_time - end_time)/block_size) *
rate_per_block))*surcharge;
}
else
{
call_cost = call_cost + (((start_time - end_time)/block_size) *
rate_per_block);
}
}
}
}