Skip to content

Instantly share code, notes, and snippets.

@pepet96
Created November 6, 2013 05:03
Show Gist options
  • Save pepet96/7331181 to your computer and use it in GitHub Desktop.
Save pepet96/7331181 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
import java.io.*;
class Shirts {
public static void main (String [] args) throws IOException {
Scanner input = new Scanner(System.in);
double shirts,total;
System.out.println("This program will calculate the total price for your order. \nPlease enter the number of shirts you want to buy: ");
shirts = input.nextDouble();
if (shirts > 3) {
total = shirts*10;
System.out.println("The price of your order is: $" + total);
}
else if (shirts >= 0){
total = shirts*12;
System.out.println("The price of your order is: $" + total);
}
else if (shirts < 0){
System.out.println("The value you entered is not possible!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment