• + 0 comments

    Using explicit type casting to convert double into an int

    double tip = meal_cost/100*tip_percent; double tax = meal_cost/100*tax_percent;

    int total_cost =  (int)(meal_cost+tip+tax);
    System.out.println(total_cost);