ThreeArrayList 1 Answer(s) 3 years and 3 months ago
Posted in : Java Beginners
I can't get the message to output in my software Eclispe. I need this by 5pm CST...Thank You'
package tal; import java.util.ArrayList;
public class ThreeArrayLists { public static void main(String[] args) { ArrayList priceList = new ArrayList(); ArrayList quantityList = new ArrayList(); ArrayList amountList = new ArrayList();
for(int i = 0; i < 10; i++) { amountList.add((Double.valueOf(priceList.get(i).toString())) * (Double.valueOf(quantityList.get(i).toString()))); System.out.printf("%d)%.2f*%.2f = %.2f\n", i + 1, Double.valueOf(priceList.get(i).toString()), Double.valueOf(quantityList.get(i).toString()), Double.valueOf(amountList.get(i).toString())); } }
View Answers
February 15, 2010 at 10:40 AM
Hi Friend,
Try it:
import java.util.ArrayList;
public class ThreeArrayLists{ public static void main(String[] args) { ArrayList priceList = new ArrayList(); ArrayList quantityList = new ArrayList(); ArrayList amountList = new ArrayList();