Been awhile here is C# app

It’s been a while so here is a basic app that will allow the calculation of how petrol price based on distanced traveled.

PetrolCharge.PNG

This is done via the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int distance;
distance = int.Parse(txtboxDistance.Text);
double price = 0;

if (distance <= 8)
{
price = distance * 0.50;
}
else if (distance > 8)
{
price = 8 * 0.50 + (distance-8) * .30;
}

price = double.Parse(price.ToString());
txtboxCost.Text = price.ToString();