Hi dev,
In this article we will learn example about checks speed limits by given input parameter using javascript. Let's start …
Syntax & Example:
speed-limits.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>speed-limits</title>
<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
<body>
<h1>5-speed-limits!</h1>
<h3>Write a function which checks given input/parameter:</h3>
<ul>
<li>If input/parameter is below speedlimit of 70 print => 'Good Safe Driving'</li>
<li>If input/parameter is above speedlimit of 70, every 5 kilometers is Penalty Point, print => 'Speed Limit Crossed by Penalty Point' + Point </li>
<li>If Driver gets more than 10 penalty points ie. above the speed limit 120, print => 'License Suspended'</li>
</ul>
<script type="text/javascript" src="script.js"></script>
</body>
</html>
Syntax & Example:
script.js
console.log('5-speed-limits');
/*
<h3>Write a function which checks given input/parameter:</h3>
<ul>
<li>If input/parameter is below speedlimit of 70 print => 'Good Safe Driving'</li>
<li>If input/parameter is above speedlimit of 70, every 5 kilometers is Penalty Point, print => 'Speed Limit Crossed by Penalty Point' + Point </li>
<li>If Driver gets more than 10 penalty points ie. above the speed limit 120, print => 'License Suspended'</li>
</ul>
*/
const SPEEDLIMIT = 70;
const KMPERPOINT = 5;
function checkSpeedLimit(curSpeed) {
if (curSpeed <= SPEEDLIMIT) {
return ('Good Safe Driving!');
} else {
let penaltyPoint = Math.floor((curSpeed - SPEEDLIMIT) / KMPERPOINT);
if (penaltyPoint < 10) {
return ('Speed Limit Crossed by Penalty Point: ' + penaltyPoint);
} else {
return ('License Suspended!');
}
}
}
let checkPoin1 = checkSpeedLimit(40);
console.log(checkPoin1);
let checkPoin2 = checkSpeedLimit(70);
console.log(checkPoin2);
let checkPoin3 = checkSpeedLimit(75);
console.log(checkPoin3);
let checkPoin4 = checkSpeedLimit(99);
console.log(checkPoin4);
let checkPoin5 = checkSpeedLimit(120);
console.log(checkPoin5);
Hope it can help you…
Categories : JavaScript
Tags : HTML
tricor 200mg pill purchase fenofibrate online cheap fenofibrate over the counter
cialis 10mg brand buy viagra 50mg for sale order sildenafil without prescription
order precose without prescription buy micronase 5mg without prescription griseofulvin 250 mg us
aspirin 75 mg cheap aspirin price order imiquimod for sale
dipyridamole 25mg sale buy generic lopid cost pravastatin 10mg
order dydrogesterone for sale forxiga 10mg over the counter order empagliflozin 25mg without prescription
prasugrel 10 mg price buy generic tolterodine over the counter detrol 2mg generic
buy pyridostigmine online cheap buy piroxicam 20 mg generic maxalt 10mg brand
buy generic ferrous 100 mg ascorbic acid 500mg canada pill betapace 40 mg
where to buy vasotec without a prescription buy doxazosin 1mg online buy lactulose cheap
order latanoprost for sale buy rivastigmine 6mg pills rivastigmine brand
purchase premarin for sale premarin order viagra drug
purchase omeprazole metoprolol online buy order lopressor online
order telmisartan 20mg without prescription hydroxychloroquine pills molnupiravir where to buy
order tadalafil 20mg online cheap cialis in usa viagra order online
oral cenforce cenforce 50mg tablet buy chloroquine 250mg pill
cost modafinil modafinil 100mg over the counter purchase prednisone sale
omnicef 300mg for sale buy generic glycomet prevacid usa
accutane 40mg pills azithromycin 250mg without prescription order zithromax 500mg generic
order azipro 250mg online buy omnacortil 5mg for sale gabapentin for sale
buy atorvastatin 20mg online amlodipine 10mg generic norvasc 10mg without prescription
casino world online roulette real money order lasix online
slot games free empire casino online best antihistamine pills
purchase protonix sale buy phenazopyridine without a prescription cost pyridium
online casino real money paypal real casino online ivermectin 2mg
real money online blackjack purchase amoxiclav for sale levothyroxine brand
order symmetrel online avlosulfon 100 mg pills aczone 100mg price
buy serophene online cheap order imdur 20mg generic order imuran 50mg online cheap
medrol 16 mg tablet order adalat online cheap cost triamcinolone 4mg
vardenafil 20mg cost brand vardenafil 10mg purchase tizanidine pills
dilantin 100 mg cheap phenytoin buy online buy oxytrol online cheap
buy coversum pills aceon 8mg us fexofenadine 180mg pill
baclofen for sale online buy toradol 10mg pill buy toradol paypal
where to buy claritin without a prescription priligy 90mg sale priligy 30mg usa
brand baclofen 25mg amitriptyline 10mg without prescription order toradol 10mg generic
order fosamax 35mg pill colcrys order order furadantin 100mg generic
inderal 20mg drug clopidogrel online buy clopidogrel 75mg online cheap
buy pamelor 25 mg pills buy methotrexate 10mg pills buy panadol 500 mg without prescription
glimepiride tablet cytotec order order arcoxia without prescription
warfarin 2mg generic buy paroxetine no prescription buy metoclopramide 10mg for sale
orlistat us order xenical 60mg generic diltiazem for sale
famotidine 20mg generic tacrolimus 5mg oral buy tacrolimus 5mg generic
buy astelin online cheap irbesartan 300mg tablet order irbesartan 150mg online cheap
buy nexium 40mg generic how to get esomeprazole without a prescription buy topamax 100mg pills
sumatriptan 50mg oral buy sumatriptan avodart 0.5mg pills
buy zyloprim 100mg pills buy crestor 20mg for sale generic rosuvastatin 20mg
zantac 300mg tablet buy ranitidine without prescription celecoxib 100mg oral
buspirone 5mg over the counter buy amiodarone 100mg buy cordarone 100mg pills
flomax cost zocor 20mg generic generic simvastatin
motilium sale order tetracycline 250mg pill tetracycline 500mg generic
buy generic aldactone 100mg how to buy aldactone buy generic propecia
teach me how to write an essay academic writing support pay for dissertation
fluconazole 100mg over the counter acillin sale baycip order online
order aurogra 50mg pill buy yasmin for sale estrace 2mg pill
buy flagyl 400mg for sale buy cephalexin 250mg for sale keflex 125mg without prescription
lamictal sale buy lamictal cheap buy vermox 100mg pills
buy clindamycin medication buy fildena pill best ed pills non prescription
tretinoin for sale online buy tadalafil 20mg for sale buy avanafil 100mg pill
buy cheap generic nolvadex buy rhinocort cheap rhinocort order online
tadalafil 20mg generic order tadacip 10mg pills buy generic indomethacin
ceftin 250mg drug buy careprost cheap order methocarbamol pills
trazodone over the counter buy suhagra 50mg generic how to get clindac a without a prescription
buy generic terbinafine 250mg casino play best online blackjack real money
order aspirin online cheap order aspirin 75mg generic free spins no deposit uk
buying essay research paper science order suprax 200mg pill
write my term paper best casino games slots free online
trimox over the counter cheap anastrozole order clarithromycin 250mg online cheap
buy rocaltrol pills buy fenofibrate pills order tricor 160mg online
expensive zit pills order oxcarbazepine 600mg online buy trileptal 600mg
buy catapres for sale buy cheap generic antivert order generic spiriva 9 mcg
buy uroxatral medication infant stomach cramp prescription medication medicine for sharp stomach pain
minocin 50mg ca buy cheap generic minocin order ropinirole pills
best sleep aid at walgreens best weight loss pill fast buy weight loss prescriptions online
order letrozole buy albenza 400mg online purchase abilify pills
prescription pills to quit smoking new medication for quitting smoking free pain pills online
buy medroxyprogesterone pill order praziquantel 600 mg generic microzide over the counter
best supplements for herpes outbreak best medicine for diabetes 2 diabetes pills names
buy periactin 4 mg generic cyproheptadine online buy generic nizoral 200 mg
canesten cream for kids herpes 2 cure coming soon 4 most dangerous blood pressure drugs
purchase duloxetine online glipizide tablet order provigil without prescription
gastric ulcer medication side effects treatment for gram positive uti gram negative cocci causing uti
purchase phenergan purchase promethazine for sale buy stromectol canada
get estrogen prescription online alternative to cipro for prostatitis pill to increase sperm
order prednisone 40mg sale brand isotretinoin 40mg amoxicillin 1000mg tablet
zithromax order online purchase prednisolone sale generic gabapentin
order ursodiol pill zyrtec online buy zyrtec 10mg us
buy strattera 25mg online cheap order zoloft 50mg online cheap zoloft 50mg sale
purchase escitalopram without prescription naltrexone 50 mg ca where to buy revia without a prescription
purchase furosemide generic cost ventolin 4mg ventolin inhalator us
buy combivent medication dexona for sale order zyvox 600mg pill
augmentin cost clomid 100mg ca purchase clomid pill
buy nateglinide pills buy starlix paypal order candesartan 16mg generic
vardenafil 10mg uk purchase tizanidine online cheap brand plaquenil
generic tegretol 400mg cheap lincomycin buy lincocin pill
cenforce 50mg tablet order glucophage generic order metformin 500mg generic
cefadroxil 250mg sale brand duricef 250mg buy epivir online cheap
lipitor 80mg ca lipitor order online prinivil drug
oral omeprazole 20mg order prilosec generic atenolol pills
order dostinex 0.25mg generic buy dostinex 0.25mg generic dapoxetine 60mg generic
buy depo-medrol cheap medrol drug order clarinex pills
buy misoprostol 200mcg for sale diltiazem over the counter diltiazem cost
order piracetam 800 mg generic buy betamethasone 20 gm sale order clomipramine 25mg for sale
purchase acyclovir buy cheap crestor buy crestor 10mg generic
buy sporanox 100 mg generic itraconazole 100mg for sale tindamax 500mg generic
zetia for sale domperidone without prescription order sumycin pills
olanzapine 10mg oral buy bystolic diovan for sale online
flexeril 15mg pills toradol online buy buy ketorolac for sale
buy gloperba generic inderal 10mg sale how to buy methotrexate
how to get rid of spots on face dapsone 100 mg pills best prescription topical for acne
allergy pills non drowsy how to get theo-24 Cr without a prescription allergy pills prescribed by doctors
best fast acting heartburn relief common heartburn medication prescription
basic care sleep aid modafinil pills
where to buy prednisone without a prescription order prednisone 20mg pills
medicine for acidity problems buy altace 10mg
prescribed acne medication names order generic deltasone 20mg acne treatments that work uk
best medication for heartburn purchase baycip
order accutane pill accutane canada isotretinoin online order
uk sleeping pills website buy meloset online cheap
amoxil 250mg ca cost amoxicillin 1000mg buy amoxil generic
where to buy zopiclone pills doxylamine uk over the counter
azithromycin for sale order azithromycin 250mg pills order zithromax without prescription
buy generic neurontin over the counter order gabapentin 800mg generic
azipro 500mg usa order azithromycin 250mg generic how to buy azithromycin
buy cheap lasix how to get lasix without a prescription
order omnacortil 20mg pill prednisolone 10mg tablet cost prednisolone 20mg
buy generic amoxil 500mg buy amoxicillin pills order generic amoxicillin 250mg
doxycycline usa doxycycline order
order ventolin for sale albuterol inhalator online order albuterol pill
amoxiclav drug augmentin 375mg us
levothyroxine pill cheap synthroid for sale how to buy synthroid
buy vardenafil tablets order levitra sale
zanaflex price tizanidine 2mg pills order generic tizanidine
rybelsus 14mg for sale rybelsus buy online semaglutide over the counter
order deltasone 40mg pills brand deltasone 10mg purchase prednisone generic
buy generic rybelsus for sale order semaglutide pill semaglutide price
accutane 10mg over the counter isotretinoin 20mg brand how to buy accutane
ventolin pills ventolin inhalator online order purchase ventolin inhaler
oral amoxil amoxicillin 1000mg drug amoxicillin 500mg pill
order augmentin 375mg pill buy clavulanate tablets augmentin 625mg usa
buy zithromax 500mg pill buy cheap generic zithromax buy zithromax pills
buy synthroid pill buy cheap generic levothyroxine buy synthroid 150mcg pills
prednisolone 10mg pill buy generic prednisolone over the counter cheap omnacortil generic
casino online games for real money casino moons online casino big fish casino online
vardenafil pills cost levitra 20mg levitra 10mg usa
pregabalin 75mg tablet pregabalin for sale online lyrica 75mg us
buy hydroxychloroquine pills buy plaquenil paypal cheap hydroxychloroquine 400mg
buy cheap aristocort purchase aristocort sale buy aristocort generic
cialis 20mg uk brand tadalafil 5mg otc cialis
clarinex 5mg pill buy clarinex 5mg generic buy desloratadine 5mg without prescription
oral cenforce 100mg buy cenforce purchase cenforce sale
order loratadine 10mg online purchase loratadine generic order loratadine without prescription
aralen 250mg us chloroquine price chloroquine buy online
buy orlistat without prescription xenical cost buy diltiazem pills
buy lipitor 10mg atorvastatin 40mg pill lipitor 10mg cost
order acyclovir 400mg without prescription zovirax 400mg canada buy zyloprim cheap
amlodipine online order purchase norvasc without prescription amlodipine price
zestril medication zestril 5mg for sale buy lisinopril without a prescription
purchase crestor sale buy ezetimibe online cost zetia 10mg
brand omeprazole 10mg buy omeprazole 10mg online order prilosec 20mg online cheap
buy cheap generic motilium cheap domperidone tetracycline online order
lopressor 100mg generic lopressor generic lopressor online
cost flexeril 15mg buy generic baclofen 10mg order baclofen 25mg sale
atenolol pills order atenolol order generic tenormin 100mg
buy toradol 10mg generic colcrys pills buy colcrys generic