Question: Using C# Create a class called Insurance that contains 3 pieces of information as instance variables: name (datatype string), number of customers (datatype int), state

Using C#

Create a class called Insurance that contains 3 pieces of information as instance variables: name (datatype string), number of customers (datatype int), state where corporate headquarters are located (datatype string).

Create a constructor that initializes the 3 instance variables. The Insurance class must contain a C# property for each instance variable for get and set. These are not java access and mutators. The property for number should verify that the Insurance customers is greater than zero. If a negative value is passed in, the set accessor should set the Insurance number to 0.

Create a second class Insurance Test that prompts the user for information to create two Insurance objects using the constructor that you developed in the Insurance class. Display the name, number of customers, home state.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!