Here I am again for my weekly Sunday night help. Sigh. How can I pass my error message into my exception? Thanks.
Let me know if you need to see more of the code.
/* Create an error message that is passed to the Exception class constructor for the Message property
* when a book does not meet the price-to-pages ratio. */
public void displayErrorMessage()
{
string msg = "Ratio for " + Title + " is invalid. Price is " + Price + " for " + NumPages + " pages.";
}
} //End Book Class
/*Create a BookException class with a constructor that requires three (3) arguments for each book:
* a string title, a double price, and an int number of pages. */
public class BookException : Exception
{
string displayErrorMessage(msg);
public BookException(string Title, double Price, double NumPages)
: base (msg)
{
}
public BookException()
{
}
} //End BookException Class