Created
November 13, 2013 23:50
-
-
Save pepet96/7458664 to your computer and use it in GitHub Desktop.
OrderChecker
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; | |
| class OrderChecker { | |
| public static void main(String [] args) { | |
| Scanner input = new Scanner(System.in); | |
| int bolt, nut, wash; | |
| double total; | |
| System.out.println("Enter number of bolts: "); | |
| bolt = input.nextInt(); | |
| System.out.println("Enter number of nuts: "); | |
| nut = input.nextInt(); | |
| System.out.println("Enter number of washers: "); | |
| wash = input.nextInt(); | |
| if (nut < bolt) { | |
| System.out.println("Check the order, total amount will not be calculated."); | |
| } | |
| else { | |
| total = (bolt * .05) + (nut * .03) + (wash * .01); | |
| System.out.println("The order is okay, the total amount is: " + total); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment