I'm a bit of a novice when it comes to programming, wanting to learn.
I'm trying to write a program that has a while loop in it, or preferrably a do..while loop but I can't seem to call methods within a nested if statement in the while loop.
How is this done? Have I been clear enough?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main()
{
int userChange, twoPoundCoin, onePoundCoin, fiftyPCoin, twentyPCoin,
tenPCoin, fivePCoin, twoPCoin, onePCoin;
Console.WriteLine("Please enter an amount in pence: ");
userChange = Convert.ToInt32(Console.ReadLine());
do
{
if (userChange >= 199)
{
LargeCoins();
}
else if (userChange >= 9)
{
MediumCoins();
}
else if (userChange >= 1)
{
SmallCoins();
}
} while (userChange != 0);
}
}
}
Any help would be, well, helpful,
Cheers.