The license plate must meet the following specifications:
· It must contain three digits.
· It must contain three uppercase letters.
The foreach loop will be used to examine each character in the license plate that was entered by the user as a string. If an invalid character is found in the string, display the character with an error message. If an incorrect number of characters or digits are found in the plate, display an error message for each error. If a lowercase letter is encountered, display an error message.
If the license plate contains no errors, display the plate and a string indicating that it is valid.this what supposed to look like...

this all i got, i dont know what to do next...could someone help me.
Console.WriteLine("{0, 40}", "ICA17 - License Plate Checker");
string sLicence;
string sAgain;
do
{
Console.Write("\nEnter a license plate number: ");
sLicence = Console.ReadLine();
foreach (char cCh in sLicence)
{
Console.Write("{0}", cCh);
}
Console.Write("\nRun again? \"yes\" to enter another plate: ");
sAgain = Console.ReadLine();
}
while(sAgain == "yes");
Console.ReadLine();
Deepak VermaPosted Mar 28, 2011, 2:40 AM
I hope the following code will help you :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(String[] args)
{
Console.WriteLine("{0, 40}", "ICA17 - License Plate Checker");
string sLicence;
string sAgain;
int ASCII, dCount, cCount, lCheck, cInvalid;
do
{
cInvalid = lCheck = dCount = cCount = 0;
Console.Write("\nEnter a license plate number: ");
sLicence = Console.ReadLine();
foreach (char cCh in sLicence)
{
//Console.WriteLine("{0}", cCh);
ASCII = (int)cCh;
if (CheckInvalidChars(ASCII) == 0)
{
cInvalid++;
Console.WriteLine("The {0} character is not valid.", cCh);
}
if (ASCII > 47 && ASCII < 58) //Counts the number of Digits in String
dCount++;
if (ASCII > 64 && ASCII < 91) //Counts the number of Uppercase Letters in String
cCount++;
if (ASCII > 96 && ASCII < 123)//Checks whether string contains any lower case letter
lCheck++;
}
if (dCount != 3)
Console.WriteLine("License Plate must contain 3 Digits.");
if (cCount != 3)
Console.WriteLine("License Plate must contain 3 Uppercase Letters.");
if (lCheck > 0)
Console.WriteLine("Lowercase Letter(s) are not allowed in License Plate");
if (cInvalid == 0 && dCount == 3 && cCount == 3 && lCheck == 0)
Console.WriteLine("{0}is a valid License Plate", sLicence);
Console.Write("\nRun again? \"yes\" to enter another plate: ");
sAgain = Console.ReadLine();
}
while (sAgain == "yes");
Console.ReadLine();
}
static int CheckInvalidChars(int a)//Returns 0 if invalid characters found.
{
if ((a > 47 && a < 58) || (a > 64 && a < 91) || (a > 96 && a < 123))
return 1;
else
return 0;
}
}
}