Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ReturnErrors
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine(DecoratePlanet("Mars"));
- Console.WriteLine("Is Pluto really a dwarf...?");
- Console.WriteLine(IsPlutoADwarf());
- Console.WriteLine("Then how many planets are there in the galaxy...?");
- Console.WriteLine(CountThePlanets());
- }
- static string DecoratePlanet(string planet)
- {
- return $"*..*..* Welcome to {planet} *..*..*";
- }
- //takes no arguments
- //not to create variable and use them before declaration
- static bool IsPlutoADwarf()
- {
- return true;
- }
- static string CountThePlanets()
- {
- return "8 planets, usually";
- }
- }
- }
- /*
- For IsPlutoADwarf() method:
- Steps is to
- 1. define a variable
- 2. set a value to it (can be in the same line as step 1)
- 3. then return its value.
- DO NOT do all that in just one line of code.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement