Here is de ad of the excercise:
ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits.
If the function is passed a valid PIN string, return true, else return false.
eg:
ValidatePin("1234") => true
ValidatePin("12345") => false
ValidatePin("a234") => false
And here is the code with the error:
using System;
using System.Text.RegularExpressions;
public class Kata
{
public static bool ValidatePin(string pin)
{
int pinn; //int called pinn declared
int cont=0; // the same that the count
int i; //and the variable i for identify the for
for(i=0;i<9999;i++)
{
cont +=1;
}
Console.WriteLine("Please enter the PIN:"); //tell the user to type the PIN number
Console.ReadLine(pinn); //read the num pinn
if(pinn>cont) //if
{
Console.WriteLine("Wrong output for",pinn);
}
return true || false;
}
Error:
Time: 1889ms Exit Code: 1 Test Results: Log src/Solution.cs(16,13): error CS1501: No overload for method 'ReadLine' takes 1 arguments src/Solution.cs(16,22): error CS0165: Use of unassigned local variable 'pinn'