Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8092583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:19:01+00:00 2026-06-05T20:19:01+00:00

Okay at the moment I my self am new to programming and learning it

  • 0

Okay at the moment I my self am new to programming and learning it slowly. At the moment I am taking programming classes to help better understand programming. I have ran in to a problem that has stumped me.

Now while I can do the assignment in a different way and manner as compared to what I provided. My question is, why is this happening? I get no errors, what so ever, the only thing that happens is after the input the Console Fezzes. I want to know what I did wrong.

static void Main(string[] args)
{

    double[] Population = new double[6];
    string[] Years = { "2", "3", "4", "5", "6", "7" };
    double GrowthPercentage = 0.0;
    double MathPercentage = 0.0000;
    double ActualGrowth = 0.0;
    int WhileCounter = 0;

    //Ask user for Population of Roarkville
    Console.WriteLine("Enter the Population of RoarkVille: ");
    //Read Population and store
    Population[0] = Convert.ToDouble(Console.ReadLine());
    //Ask user for Growth percentage
    Console.WriteLine("Enter the Growth percentage ");
    //Read Growth Percentage
    GrowthPercentage = Convert.ToDouble(Console.ReadLine());
    //Calculation of Growth Percentage: Growth Percentage/100 = Math Percentage 
    MathPercentage = GrowthPercentage / 100;
    //ActualGrowth = Population * Math Percentage 

    //Population2 = ActualGrowth + Population 

    while (WhileCounter < 5)
    {
       ActualGrowth = Population[WhileCounter] + MathPercentage;

       WhileCounter++;

       Population[WhileCounter] = ActualGrowth + Population[WhileCounter--];
    }

    for (int i = 0; i < Population.Length; i++)
    {
        Console.WriteLine("Population of 201{0:d}", Years[i]);
        Console.WriteLine(Population[i]);
    }
    //Display 2012 Population 

    //Display 2013 Population 

    //Display 2014 Population 

    //Display 2015 Population 

    //Display 2016 Population 

    //Display 2017 Population

    Console.ReadLine();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:19:02+00:00Added an answer on June 5, 2026 at 8:19 pm

    The ++ operator changes the actual value of the variable, so WhileCounter++ increases the variable by 1

    The — operator does the same, which is not what you want to do in the line

    Population[WhileCounter] = ActualGrowth + Population[WhileCounter--];
    

    Instead, use WhileCounter - 1 , like so

    Population[WhileCounter] = ActualGrowth + Population[WhileCounter - 1];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, at the moment I have the following in my model: has_many :current_monitorings, :class_name
Okay, at the moment on my site I have a feature that blacklists words,
Okay, at the moment i have my domain's host file which was generated by
Okay, so I've got a Postgres database hosted on a VPS at the moment,
Okay, next PHPExcel question. I have an HTML form that users fill out and
Okay this question is very simple: I have a facebook page, and a website.
Okay, I have the following create action #posts_controller, nested resource under discussions def create
Okay, so I have my post.php page. If you are not logged in, you'll
Okay - I have a dilemma. So far my script converts page titles into
Okay,.. I'm looking into technologies for a 'Case Management' solution design at the moment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.