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

Monday, September 2, 2019

Codecademy Arithmetic Operators 3/8


// Sample Solution
using System;

namespace PlanetCalculations
{
  class Program
  {
    static void Main(string[] args)
    { 
      // Your Age
int userAge = 65;

      // Length of years on Jupiter (in Earth years)
double jupiterYears = 11.86;

      // Age on Jupiter
double jupiterAge = userAge / jupiterYears;

      // Time to Jupiter
double journeyToJupiter = 6.142466;

      // New Age on Earth
double newEarthAge = userAge + journeyToJupiter;

      // New Age on Jupiter
        double newJupiterAge = newEarthAge / jupiterYears;

      // Log calculations to console
Console.WriteLine(userAge);
                        Console.WriteLine(jupiterAge);
Console.WriteLine(newEarthAge);
Console.WriteLine(newJupiterAge);
    }
  }
}

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts