- 2
How to solve the problem of adding one demerit point after every 5 km speed?
Write a function for checking the speed of drivers. this function should have one parameter:speed. If speed is less than 70,it should print "ok". Otherwise, for every 5km above the speed limit(70), it should give the driver one demerit point and print the total number of demerit points. For eg. if the speed is 80, it should print "points:2" If the driver gets more than 12 points, the function should print:"license suspended". I beg u to solve this question.
3 ответов
+ 8
Have you tried to do something ?
Please try to write a code, even if you don't know much and it doesn't work, post it here, and then we'll help you to get it right.
0
Any answers for this? Im struggling for this question too.
- 1
I can solve your problem using JavaScript or C++