Working on an assignment using c# and visual studio. I want the user to type in how many days they worked and the pay for each day to show in a listbox. However, the pay needs to double each day. So day 1 they get 1 penny, day 2 they get 2 pennies, day 3, they get 4 pennies, etc. Having trouble getting to increase by 2x, while still keeping the count only going up by one day.
What I have tried:
//declare the variables
double dblDays;
double dblPay;
int intCounter=1;
if (Double.TryParse(txtDays.Text, out dblDays))
{
for (intCounter = 1; intCounter <= dblDays; intCounter ++)
{
dblPay = (dblDays*.01) * intCounter;
lstDays.Items.Add("Pay for Day" + intCounter.ToString() + "=" + dblPay.ToString("c"));
lblTotalPayEarnedTotal.Text = dblPay.ToString("c");