I created the program below, but can't figure out how to get the test data to show 40 days worth, but only the EVEN days from 2 to 40.
// Program created by MY NAME to determine a person's earnings in
// pennies, by doubling each day, starting at 1 penny.
#include <iostream>
using namespace std;
int main()
{
// Variables
int days; // Each day worked.
double final = 1,
total = 0.00;
// Asks for number of days worked to determine salary.
cout << "Enter the number of days: ";
cin >> days;
for( int i = 1; i < ( days + 1 ); i++ )
{
cout << "Day " << i << ": " << "$" << final / 100 << endl;
Bookmarks