Created
December 2, 2013 00:56
-
-
Save pepet96/7743205 to your computer and use it in GitHub Desktop.
Financial Management
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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