I was given a homework assignment to create a program to convert money in accounts from usd to yen. With the code given to us, this is what I have came up with so far:
I cannot figure out how to get it to work correctly. Any help would be greatly appreciated.import java.util.*; class DollarToYen { public static final int MAX_DEPOSITS = 100; public static final float DOLLAR_TO_YEN = 0.098f; // read number of Dollars in each account from the keyboard void readDollars(float[] dollars, int count ) { Scanner kb = new Scanner(System.in); for(int j = 0; j < count; j++) { System.out.print("Enter the deposit amount(dollars) : $"); j = kb.nextInt(); } } // Convert Dollars to Yen void dollarsToYen(float dollars[],float yen[],int count) { // for (int j = 0; j < count; j++ ) // /DOLLAR_TO_YEN; } // Display the amount in each account in both Dollars and Yen void displayData(float dollars[],float yen[],int count ) { for(int j = 0; j < count; j++ ) { System.out.println("\nAccount ["+(j+1)+"] : "); System.out.println("\t"+dollars[j]+" dollars"); System.out.println("\t"+yen[j]+" yen"); } System.out.println(); } public static void main(String[] args) { int num; // Actual number of deposits float[] dollars = new float[MAX_DEPOSITS]; // Dollars float[] yen = new float[MAX_DEPOSITS]; // Yen Scanner kb = new Scanner(System.in); DollarToYen deposits = new DollarToYen(); // Prompt the user for the number of deposits System.out.print("Enter the number of deposits: "); num = kb.nextInt(); // Read the amount in each deposit deposits.readDollars( ); // Convert Dollars to Yen. deposits.dollarsToYen( ); // Display the amount in each deposit deposits.displayData( ); } }