I’m quite a newbie at c# and need some help with some loop statements.
I’m practising by designing a program that calculates cost per mile (which is 50p) and adds £30.00 every 1000 as a wear $ tear charge.
I’m having problems getting my head around the logic, if anyone could give me a few tips that would be great.
namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Input start milleage:");
decimal StartMile = Convert.ToDecimal(Console.ReadLine());
Console.WriteLine("Input Finish milleage:");
decimal FinishMile = Convert.ToDecimal(Console.ReadLine());
decimal TotalMilleage = FinishMile - StartMile;
if (TotalMilleage < 1000)
TotalMilleage = TotalMilleage / 2;
Console.WriteLine("Total charge for hire:{0:C}", TotalMilleage);
Theres the code Ive done so far :S
You do not need loop just make expression like this, Assuming £30 only charged after 1000 miles.