Quotes help make search much faster. Example: "Practice Makes Perfect"

Tuesday, September 3, 2019

Codecademy Expression-bodied Definitions 2/6


// Sample Solution
using System;

namespace AlternateExpressions
{
  class Program
  {
    static void Main(string[] args)
    {
      Welcome("Earth");
      double days = 500;
      double rotations = DaysToRotations(days);
      Console.WriteLine($"In {days} days, the Earth has rotated {rotations} time(s).");
    }
   
    static double DaysToRotations(double days) => days / 365;

    static void Welcome(string planet) => Console.WriteLine($"Welcome to {planet}!");
  }
}

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts