Hey guys, i am working on a program and it deals with arrays. Basicaly its a conversation program i am working on. I have alot of it done but i am stuck with the displayiong of the info. Now being this is an assignment i would really like advices and tips that i should look or maybe explanations. If you guys have any tips please lemme know.
#include <stdio.h>
#include <stdlib.h>
//#include <iomanip.h>
const int MAX_CURRENCYS = 100; /* Max number of dollar Deposits 100$ */
const float DOLLARS_TO_YEN = 102.2; /* 1 Dollar = 102.2 Yen this is the value of the yen*/
/* Function declarations */
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 nums; // input the number of deposit */
float Dollars[MAX_CURRENCYS], /* Dollars value the user wishes to put in his accounts*/
Yen[MAX_CURRENCYS]; /* Yen value the user wishes to put in his accounts*/
/* Prompt the user for the number of deposits. */
printf("\n Enter the number of deposits: ");
scanf("%d", &nums);
// Read the amount in each deposit .
readDollars(Dollars,nums);
// Convert Dollars to Yen.
DollarsToYen (Dollars, Yen, nums);
// Display the amount in each deposit
displayData(Dollars,Yen,nums);
}
/* read number of Dollars in each account from the keyboard */
void readDollars ( float Dollars[], int count )
{
int j;
printf("Enter the dollar amount for each : ");
for ( j=0; j < count; j++ )
scanf("%f",&Dollars);
}
/*gives number of Yen in each account */
void DollarsToYen ( float Dollars[], float Yen[], int count )
{
int j;
for (; j < count; j++)
Yen = Dollars * DOLLARS_TO_YEN;
printf("","The conversion of $ to y is %10.2f\n",Yen);
}
/* displays the amount in each account in both Dollars and Yen */
void displayData ( float Dollars[], float Yen[], int count )
{
int j;
printf("\n Dollars Yen \n");
for (; j < count; j++)
printf(" %7f %12f \n", Dollars, Yen );
}
The program was running before but my error occurs on the hilighted line. it says invalid operations to binary.
If i finish it in the meantime i will post my results! Thanks For any tips given