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 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
Get step-by-step solutions from verified subject matter experts
