Skip to content

Instantly share code, notes, and snippets.

@pepet96
Created December 2, 2013 00:56
Show Gist options
  • Save pepet96/7743205 to your computer and use it in GitHub Desktop.
Save pepet96/7743205 to your computer and use it in GitHub Desktop.
Financial Management
import java.util.Scanner;
public class finance {
public static void main (String [] args) {
Scanner input = new Scanner(System.in);
double sum = 0;
int i;
for (i = 0; i < 12; i++){
double value = input.nextDouble();
sum = sum + value;
}
sum = sum/12;
double roundOff = Math.round(sum * 100.0) / 100.0;
System.out.println("$" + roundOff);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment