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

Monday, September 2, 2019

Codecademy Review 8/8


// Sample Solution
// Compound Interest = Future Value - Principal
// CI = P[((1+i)^n)-1]

using System;

namespace Review
{
  class Program
  {
    static void Main(string[] args)
    {
      /* use this space to write your own short program!
      Here's what you learned:

      DATA TYPES: int, double
      ARITHMETIC OPERATORS: +, -, *, /
      INCREMENT/DECREMENT: ++, --
      MODULO: %
      BUILT-IN METHODS: Abs, Pow, Sqrt, Floor, Ceiling, Min, Max

      Good luck! */
      int numberOfPeriods = 5;
      double interestRate = 0.01;
      double principal = 10000;
      double futureValue = principal * Math.Pow((1+interestRate),numberOfPeriods);
      double compoundInterest = futureValue - principal;
      Console.WriteLine(compoundInterest);
    }
  }
}

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts