We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 2: Operators
Day 2: Operators
Sort by
recency
|
3348 Discussions
|
Please Login in order to post a comment
def solve(meal_cost, tip_percent, tax_percent): # Calculate tip amount tip = meal_cost * (tip_percent / 100)
Read input from stdin
meal_cost = float(input()) tip_percent = int(input()) tax_percent = int(input())
Call the solve function with input values
solve(meal_cost, tip_percent, tax_percent)
System.out.println(Math.round(meal_cost+(tip_percent*meal_cost/100)+(tax_percent*meal_cost/100)));
My Solution JavaScript
here is code if anyone stuck in java import java.io.; import java.math.; import java.security.; import java.text.; import java.util.; import java.util.concurrent.; import java.util.function.; import java.util.regex.; import java.util.stream.*; import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList;
class Result {
}
public class Solution { public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
}
Java: