Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

conditional statement problems in java

import java.util.Scanner;
class Ans{
  public static void main(String[] args){
    Scanner s = new Scanner(System.in);
    System.out.println("Enter quantity");
    int x = s.nextInt();
    if((x*100)>1000){
      System.out.println("You get a discount of "+(.1*x*100)+" and your total cost is "+(x*100-(.1*x*100)));
    }
    else{
      System.out.println("No discount");
    }
  }
}
Source by www.codesdope.com #
 
PREVIOUS NEXT
Tagged: #conditional #statement #problems #java
ADD COMMENT
Topic
Name
7+7 =