Question: 3. Status Code Given the sample code below, what is the output of the Main method? void Main() { var star = new DeathStar(); star.DestroyThePlanet();

 3. Status Code Given the sample code below, what is the

3. Status Code Given the sample code below, what is the output of the Main method? void Main() { var star = new DeathStar(); star.DestroyThePlanet(); var statusCode = star.GetStatusCode(); Console.WriteLine("Status Code: " + statusCode); } public class DeathStar { protected int StatusCode { get; set; } public void DestroyThePlanet() { try { FireTheSuperLaser(); StatusCode = 99; } catch (InvalidOperationException) { Console.WriteLine("Attempting recovery"); this. StatusCode = 200; return; } catch (Exception) { Console.WriteLine("Complete Destruction Imminent"); this.StatusCode = 100; return; 3. Status Code Given the sample code below, what is the output of the Main method? void Main() { var star = new DeathStar(); star.DestroyThePlanet(); var statusCode = star.GetStatusCode(); Console.WriteLine("Status Code: " + statusCode); } public class DeathStar { protected int StatusCode { get; set; } public void DestroyThePlanet() { try { FireTheSuperLaser(); StatusCode = 99; } catch (InvalidOperationException) { Console.WriteLine("Attempting recovery"); this. StatusCode = 200; return; } catch (Exception) { Console.WriteLine("Complete Destruction Imminent"); this.StatusCode = 100; return

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!