Answers for "calculate tip and sales tax function"

0

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);
    }
Posted by: Guest on April-06-2022

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language