c++

I am new in c++ so if anyone could rewrite ans for me then it would be helpful.please

Write a program to display the Japanese Yen value of the balance of up to 100 American Dollar bank deposits. Your program should be able to convert Dollar to Yen. Write functions that read in data, convert the currency from Dollars to Yen for each bank deposit and display the value of each deposit in both Dollars and Yen.

#include <iostream>
using std::cout;
using std::cin;
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 ()
{
int count; /* Actual number of deposits */
float Dollars[MAX_S], /* Dollars */
Yen[MAX_S]; /* Yen */

/* Prompt the user for the number of deposits. */
Cout<<"\n Enter the number of deposits: ";
Cin>>"%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 );

system("pause");
}

/* read number of Dollars in each account from the keyboard */
void readDollars ( float Dollars[], int count )
{
int j;
cout<<"Enter the dollar amount for each: ";
for ( j = 0; j < count; j++ )
cin>>"%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;
cout<<"\nNum Dollars Yen \n";
for ( j = 0; j < count; j++ )
{
Cout<<"%3d %9.2f %12.2f \n", j + 1, Dollars[j], Yen[j];
}
}


closed account (48T7M4Gy)
LOL How exactly are we to rewrite the code for you?
Excellent thread title. "C++." Almost as informative as the ever popular "Help."
closed account (48T7M4Gy)
Code picked up from the school cutting room floor? We'll probably never know.
Topic archived. No new replies allowed.