Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

calculate tip and sales tax function

    public static void solve(double meal_cost, int tip_percent, int tax_percent) {

        double tip = Math.round((tip_percent * .01) * meal_cost);
        double tax = Math.round((tax_percent * .01) * meal_cost);
        int total_cost = (int)(meal_cost + tip + tax);
        System.out.println(total_cost);
    }
Comment

PREVIOUS NEXT
Code Example
Java :: validate list of objects in javax validation 
Java :: sum of number from list 
Java :: springboot request list 
Java :: class c { public static void main(string[] args){ system.out.println("hello"+args[0]);}} output 
Java :: springBoot Register a Custom Auto-Configuration 
Java :: Start Text from top left android 
Java :: java write number with variable decimal 
Java :: java bter data atual no padrão brasileiro 
Java :: printing array in descending order 
Java :: ExpandableLayout in android 
Java :: Java HashMap Class Declaration 
Java :: how to know what a valid name for a variable is in java 
Java :: how to select multiple non-consecutive words on mac 
Java :: jsp multipart/form-data submition 
Java :: install the app from assest of other app 
Java :: Change the java version of a eclips maven project 
Java :: resources/android/xml/network_security_config.xml 
Java :: android capture view and animation 
Java :: java lambda expressions qunado foi implantada 
Java :: how to make a java lex analyzer 
Java :: java.lang.stackoverflowerror null onetomany 
Java :: antlr TestRig in java program 
Java :: conky cpu temperature 
Java :: android studio see what activity you came from 
Java :: java console readline null pointer exception 
Java :: java two constructors 
Java :: java find view by id 
Java :: x/=y is the same as x=x/y 
Java :: sartt timer of 40 second when send otp andrpid 
Java :: jsp form upload image 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =