C# Help Due Tonight

A word from our sponsor:

The Breast Form Store Little Imperfections Big Rewards Sale Banner Ad (Save up to 50% off)

I am having trouble debugging my program I can't get the Exception Handling part to work without breaking my Validation method, would love the help

Hugs :)
Michelle

// Class: CSCI 1630
// Date: 04/05/2016
/* Purpose:
*/
/*
Exercise 3 Notes: MortgageApplication is an application class; its Main() method uses two
variables for storing the name and credit score when the program acquires its input. After
collecting the inputs, the program uses the two values as arguments for a method that determines
whether they qualify for a mortgage or not.

ArguementException is an existing class that derives from Exception; you use it when one or more
of a method's arguements do not fall within an expected range. Create an application for
Merrydale Mortgage Company named MortgageApplication containing variables that can hold an applicant's
name and credit score. Within the classs, create a method that accepts a parameter for the credit
score and returns true or false, indicating whether the applicant is eligible for a mortgage.
If the score is not between 300 and 850, it is invalid, and the method should thrown an ArguementException.
An application is accepted when the credit score is valid and is atleast 650. In the Main() method,
continuosly prompt the user for applicant data, pass it to the method, and then display a message
indicating whether the applicant is accepted, rejected, or has an invalid score.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MortgageApplicationProject
{
public class MortgageApplication
{
public static void Main(string[] args)
{
int creditScore = 0;
string applicantName = "";
char userInput = 'n';

Console.WriteLine("** CSCC Mortgage Company **");
Console.Write("\nWould you like to run this program [y, n]? ");
userInput = Convert.ToChar(Console.ReadLine());

while(!(userInput == 'N' || userInput == 'n'))
{
Console.Write("Please enter the applicant's name: ");
applicantName = Console.ReadLine();
Console.Write("Enter credit score: ");
creditScore = Convert.ToInt32(Console.ReadLine());

try
{
Applicant applicant = new Applicant(applicantName, creditScore, false);
Console.WriteLine("{0} is {1}", applicantName, applicant.Status);
}

catch (ArgumentException anyException)
{
Console.WriteLine(anyException.Message);
}

Console.Write("Would you like to run this program [y, n]? ");
userInput = Convert.ToChar(Console.ReadLine());

}

Console.WriteLine("Please press the key to terminate the program.");
Console.ReadLine();
}
}
}

// Class: CSCI 1630
// Date: 04/05/2016
/* Purpose:
*/
/*
Exercise 3 Notes: MortgageApplication is an application class; its Main() method uses two
variables for storing the name and credit score when the program acquires its input. After
collecting the inputs, the program uses the two values as arguments for a method that determines
whether they qualify for a mortgage or not.

ArguementException is an existing class that derives from Exception; you use it when one or more
of a method's arguements do not fall within an expected range. Create an application for
Merrydale Mortgage Company named MortgageApplication containing variables that can hold an applicant's
name and credit score. Within the classs, create a method that accepts a parameter for the credit
score and returns true or false, indicating whether the applicant is eligible for a mortgage.
If the score is not between 300 and 850, it is invalid, and the method should thrown an ArguementException.
An application is accepted when the credit score is valid and is atleast 650. In the Main() method,
continuosly prompt the user for applicant data, pass it to the method, and then display a message
indicating whether the applicant is accepted, rejected, or has an invalid score.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MortgageApplicationProject
{
public class Applicant
{
public Applicant(string name, int creditscore, bool status)
{
Name = name;
CreditScore = creditscore;
Status = ValidateCreditScore(creditscore);
}

public string Name { get; private set; }
public double CreditScore { get; private set; }
public bool Status { get; private set;}

public bool ValidateCreditScore(int creditscore)
{
try
{
if (creditscore < 300 || creditscore > 850)
{
Console.WriteLine("test");
Console.ReadLine();
throw new ArgumentException("Value does not fall within the expected range.");
}

if (creditscore >= 650)
{
return true;
}

else
{
return false;
}
}

catch(ArgumentException anyException)
{
//public const string message = "Value does not fall within the expected range.";

//throw new ArgumentException("Value does not fall within the expected range.");

Console.WriteLine(anyException.Message);
}

}
}
}

Click Like or Love to appropriately show your appreciation for this post: