java Double Map HashMap Integer Null
Complete the function, which calculates how much you need to tip based on the total amount of the bill and the service. 完成一个函数,基于总金额和服务水平评级,计算出你需要付出多少小费 You need to consider the following ratings: 你需要参照以下关于评级的比例: Terrible: tip 0% Poor: tip 5% Good: tip 10% Great: tip 15% Excellent: tip 20% The rating is case insensitive (so “great” = “GREAT”). If an unrecognised rating is received, then you need to return: 评级不区分大小写,如果接收到无法识别的评分,则需要返回: “Rating not recognised” in Javascript, Python and Ruby… …or null in Java 或 java里的 null …or -1 in C# Because you’re a nice person, you always round up the tip,