public static void Main()
float spendingCredit = 500.00F;
float spendingMin = 00.01F;
while (spendingCredit >= 0.1) {
double randomPrice = r.NextDouble() * ((double)spendingCredit - (double)spendingMin) + (double)spendingMin;
Console.WriteLine("Purchase: " + randomPrice);
if ((float)randomPrice <= spendingCredit) {
spendingCredit -= (float)randomPrice;
Console.WriteLine("Available credit: " + spendingCredit);