import java.io.PrintStream;
import java.util.Formatter;
class HalfDollars {
public static void main(String[] arguments) {
int[] denver = { 2500000, 2900000, 3500000 };
int[] philadelphia = new int[denver.length];
int[] total = new int[denver.length];
int average;
philadelphia[0] = 2500000;
philadelphia[1] = 2900000;
philadelphia[2] = 3800000;
total[0] = denver[0] + philadelphia[0];
total[1] = denver[1] + philadelphia[1];
total[2] = denver[2] + philadelphia[2];
average = (total[0] + total[1] + total[2]) / 3;
System.out.print("2003 production: ");
System.out.format("%,d%n", total[0]);
System.out.print("2004 production: ");
System.out.format("%,d%n", total[1]);
System.out.print("2005 production: ");
System.out.format("%,d%n", total[2]);
System.out.print("Average production: ");
System.out.format("%,d%n", average);
}
}
System.out.println("2003 production: " + total[0]);
Last reply 1 month ago
Free website hosting providers with no strings attached?Posted 3 months ago
iDEA silver citizen badge three. Milkshake shack coding problem.Last reply 4 months ago
How do you practice programming java for beginners?Last reply 8 months ago
hows the employment market for tech work in the UK?Last reply 1 month ago
Free website hosting providers with no strings attached?Posted 3 months ago
iDEA silver citizen badge three. Milkshake shack coding problem.Last reply 4 months ago
How do you practice programming java for beginners?Last reply 8 months ago
hows the employment market for tech work in the UK?