Ako ste urobili tu triedu OutOfRangeException na cviku co sa malo urobit
co tam do nej treba napisat ? v Program.cs mi stale pise, ze:
Error 1 The type or namespace name 'OutOfRangeException' could not be found (are you missing a using directive or an assembly reference?) \Starter\ShapeException\ShapeException\Program.cs 82 65 ShapeException
Error 2 The type or namespace name 'OutOfRangeException' could not be found (are you missing a using directive or an assembly reference?) \Starter\ShapeException\ShapeException\Program.cs 214 20 ShapeException
a moja trieda vyzera takto:
matoda v na odchytenie pretecenia:
a catch:
moze mi niekto vysvetlit co robim zle ? som uz pozeral na milion zdrojakov na nete a nejak mi to asi nie je jasne
dik

Error 1 The type or namespace name 'OutOfRangeException' could not be found (are you missing a using directive or an assembly reference?) \Starter\ShapeException\ShapeException\Program.cs 82 65 ShapeException
Error 2 The type or namespace name 'OutOfRangeException' could not be found (are you missing a using directive or an assembly reference?) \Starter\ShapeException\ShapeException\Program.cs 214 20 ShapeException
a moja trieda vyzera takto:
Code [Select]
using System;
using System.Collections.Generic;
using System.Text;
namespace ShapeException
{
[Serializable()]
public class OutOfRangeException : System.Exception
{
public void ExcMethod()
{
Console.WriteLine("\nYour choice is OUT OF RANGE.\n");
}
}
}
matoda v na odchytenie pretecenia:
Code [Select]
public static void ValidateUserInput(string userInput, int min, int max)
{
int intInput;
intInput = Int32.Parse(userInput);
if ((intInput > max) || (intInput < min)) throw new OutOfRangeException();
}
a catch:
Code [Select]
catch (OutOfRangeException a){Console.WriteLine("Out of range.");}
moze mi niekto vysvetlit co robim zle ? som uz pozeral na milion zdrojakov na nete a nejak mi to asi nie je jasne
