should look somthin like this. I can't test this bc I have an error that makes absolutly no sense in the one "For" loop. I know there's mistakes in here bc i'm still new to this. but here is what I got
#include <iostream>
#include <cstdio>
#include <cstdlib>
usingnamespace std;
char cResponse;
double dDepositAmount[];
double dTotalDeposits;
int x; //deposit count
double dAverageDeposit;
double dothemath();
double dDoTheAverage();
int i;
main()
{
cout<<"Would you like to make a deposit? y or n";
cin>>cResponse;
switch(cResponse)
{case'y':
break;
case'Y':
break;
case'n' :
system("EXIT");
break;
case'N' :
system("EXIT");
break;
}
while(dDepositAmount > 0)
{x = x++;
cout<<"To See Average Deposit Amount Enter A Number <0 \n";
cout<<"Enter Deposit Amount";
cin >> dDepositAmount[x];
cout<<"You Entered"<<dDepositAmount[x];
if(dDepositAmount<0)
dDoTheAverage( dTotalDeposits, x);
else
dothemath(dDepositAmount,x);
}
system("PAUSE") // I know this is a no no but i havn't made my own delay() yet
}
double dothemath(double dDepositAmount[],int x)
{
for(i=0,i<x,i++)
{
dDepositAmount[i+1] = dDepositAmount[i] + dDepositAmount[i+1] ;
dTotalDeposits = dDepositAmount[i+1];
}
return dTotalDeposits;
}
double dDoTheAverage(double dTotalDeposits,int x)
{
cout<<"The Average Of The Total Of Your Deposits Is : \n";
cout<<(dTotalDeposits / x);
//how would i set this part of the problem up? I have an idea but not exactly sure
//Declare variables
//userResponse: character (y or n)
//depositAmount: floating point
//totalDeposits: floating point
//depositCount: integer
//averageDeposit: floating point
//ยท Loop until user responds no
//Prompt and input deposit amount
//Add deposit amount to total deposits
//Increment deposit count (i know to use depositcount++ for this)
//Prompt and input user's response (y or n)
//ico