Question: c# with visual studio Create a class called peasant a) The peasant class will have a. a private field called name of type string b.

c# with visual studio

c# with visual studio Create a class called peasant a) The peasant

Create a class called peasant a) The peasant class will have a. a private field called name of type string b. a private field called lifetime of type stopwatch c. a private field called eventoccurrence of double d. a private field that will hold the listbox that the peasants outputs will be sent to e. A public property that will set the listbox. f. A public property to return the peasant's name g. A public method (or property) that will return the elapsed time, in milliseconds, that the peasant has been alive A constructor that will h. i. take in a name (string) and set the private name field ii. Display in the proper listbox, "Peasant has been born into the world iii. start the lifetime stopwatch iv. randomly set evence to be a value between 0.5 and 2.0 seconds i. A function called livelife. This function will be an asynchronous function (name it properly) i. This function will have an internal loop that will loop until the lifetime is 15 seconds (while (lifeTime.ElapsedMiliseconds has been born into the world iii. start the lifetime stopwatch iv. randomly set evence to be a value between 0.5 and 2.0 seconds i. A function called livelife. This function will be an asynchronous function (name it properly) i. This function will have an internal loop that will loop until the lifetime is 15 seconds (while (lifeTime.ElapsedMiliseconds

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!