Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am a begginer and I need to Implement a function tipPercentage for the given ratings:
if rating is Terrible or Poor, then returns 3.
If rating is good or great, then returns,10
excellent, 20
if rating is none of the above, then returns 0.

Sample case 0 Sample input for Custom Testing sample output good so the tip percentage is 10

sample case 1 Sample input for Custom Testing Don't liked sample output dont liked so the tip percentage is 0

What I have tried:

I dont know how to start. I began this course today and this is in my final test but I never studied like this example, were simpler.
Posted
Updated 29-Jul-20 5:16am

1 solution

Quote:
I dont know how to start. I began this course today and this is in my final test but I never studied like this example, were simpler.


Are you kidding? I'd love to know what school teaches this way.

Well - this is how you make javascript functions - JavaScript Functions[^]


 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900