Let's do it a few items at a time. Make the changes, compile and execute for test.
When that code works, move to the next items.
Attribute : exchangeRate -Exchange rate to convert a US Dollar to ringgit
I assume that refers to the 4.17 number that is hard coded in the program.
Add a variable to the class that holds the rate and use that variable in the computations instead of the hard coded 4.17
Constructor: to set the initial value for the attribute
Add a constructor to the class that has the exchange rate as its argument. Have the constructor save that value in the variable mentioned above.
Adding these 3 lines immediately after the "public static void main..." statement will give the class a constructor that can be modified as needed:
new CurrencyConverter(); // ADDED these 3 lines
} // end main()
public CurrencyConverter() {
Is this the same problem:
https://coderanch.com/t/753313/java/...r-Java-program