Ok. I've got it to here. Why do I get all zeros for answers? Thanks.
Code:
#include <stdio.h>
#include <iomanip>
const int MAX_S = 100; /* Max number of Bank Deposits */
const float DOLLARS_TO_YEN = 102.2; /* 1 Dollar = 102.2 Yen */
/* Function prototypes */
void readDollars ( float Dollars[], int count );
void DollarsToYen ( float Dollars[], float Yen[], int count );
void displayData ( float Dollars[], float Yen[], int count );
int main (void)
{
int count; // Actual number of deposits */
float Dollars[MAX_S], /* Dollars */
Yen[MAX_S]; /* Yen */
/* Prompt the user for the number of deposits. */
printf("\n Enter the number of deposits: ");
scanf("%d", &count);
// Read the amount in each deposit .
readDollars(Dollars,count);
// Convert Dollars to Yen.
DollarsToYen(Dollars,Yen,count);
// Display the amount in each deposit
displayData(Dollars,Yen,count);
return 0;
}
/* read number of Dollars in each account from the keyboard */
void readDollars ( float Dollars[], int count )
{
int j;
for ( j = 0; j < count; j++ )
printf("Enter the dollar amount for each : ");
scanf("%f", &Dollars[j]);
}
/*gives number of Yen in each account */
void DollarsToYen ( float Dollars[], float Yen[], int count )
{
int j;
for ( j = 0; j < count; j++ )
Yen[j] = Dollars[j] * DOLLARS_TO_YEN;
}
/* displays the amount in each account in both Dollars and Yen */
void displayData ( float Dollars[], float Yen[], int count )
{
int j;
for ( j = 0; j < count; j++ )
printf(" $%.2f, %.2f", Dollars[j], Yen[j]);
}