Hi, I'm learning just general pseudocode in my class this semester. I'm having trouble understanding some of the repetition structures in the book.

The instructions for one particular problem tell me to calculate how much money is earned if the salary is one penny the first day and it doubles each day after that. I'm having trouble writing the statements that will calculate the salary. It also tells me to display the dollar amount, not the number of pennies. I'm not even asking for the answer, just some kind of push in the right direction at least.

Declare Real days, counter, salary, pennies

//Get upper limit

Display "Calculate earnings over how many days?"

Input days

//Display table headers

Display "Day", Tab, "Salary"

Display "------------------"

//Calculate & display salary

For counter = 1 to days

Having trouble with the calculation!!!

Display counter, Tab, salary

End For

I know I need a formula that doubles the amount. Would the amount start with 0.01?

Set pennies = 0.01

//Display and calculate

For counter = 1 to days

Set salary = pennies

Set pennies = pennies * 2

Display counter, Tab, salary

End For

Is that formula close?