Question
[[In C#] ][Assignment7_yourlastname.cs] Implement the following requirements: Create an Invoice class with three fields: ID number, balance due and day due. The constructor for Invoice
[[In C#] ][Assignment7_yourlastname.cs] Implement the following requirements:
Create an Invoice class with three fields: ID number, balance due and day due. The constructor for Invoice will accept three arguments for the three fields noted above. In the Invoice class constructor check that the id number falls within a constant range where the low id number is 100 and the high id number is 999. Check that the day falls within a constant range where the low day number is 1 and the high day is 31. If the ID number or the day fall outside of the specified ranges, throw an argument exception. Assign the values passed in to the corresponding class variables. Create read-only implemented accessors for ID number, balance due, and day due.
In Main instantiate an array of five (5) Invoice objects. Create a constant integer and set the default constant to 999. Prompt the user for inputs for ID number, balance, and day. For the inputs, use if statements to verify that each input for each of the three fields is the required value type (int, double, and day). If the input being checked is not the correct value type set the field equal to the default constant. Handle any exceptions (try-catch block) that are thrown when the object is instantiated. Try the assignment of each instantiation object, passing the three entered values to the object array element and catchan argument exception, assigning an instantiation using the constant default value, 0, and 1 for the ID number, balance, and day respectively. At the end of input display all the entered and possibly corrected records as shown below. Internal documentation.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started