C Console Application project with a loop which you will cre

C# Console Application project with a loop which you will create in Visual Studio.

Specification:

Determine what the population will be in Davidville in 5 years. Projections for the city\'s growth indicate that for the next five years, there will be a constant increase of 4%. This year the population in Davidville is 23,962. Display a table with the growth expectations for the next 5 years for Davidville.

Solution

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace Population
{
public class Program
{
public static void Main(string[] args)
{
int currentPopulation = 23962;
int rate = 4;
int years = 5;
  
for(int year=1;year <= years;year++)
{
currentPopulation = (currentPopulation*(100+rate))/100;
Console.WriteLine(string.Format(\"Population after {0} year(s)\\t: {1}\",year,currentPopulation));
}
}
}
}

C# Console Application project with a loop which you will create in Visual Studio. Specification: Determine what the population will be in Davidville in 5 years

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site