FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
JavaScript Scenario Task:
NewsWeb Development

JavaScript Scenario Task:

via Dev.to TutorialAnees Abdul3h ago

1)Shopping Discount System: In online shopping websites, discounts are applied based on the purchase amount. Rules Amount ≥ 5000 → 20% discount Amount ≥ 2000 → 10% discount Otherwise → No discount Members get an extra 10% discount let Amount = 5000 ; let isMember = true ; let discount = 0 ; if ( Amount >= 5000 ){ discount = 0.20 ; } else if ( Amount >= 2000 ){ discount = . 10 ; } if ( isMember ){ discount = discount + . 10 ; } let finalPrice = Amount - ( Amount * discount ); console . log ( " The final Price is " + finalPrice ); O / P : The final Price is 3500 2) Login Access Check: Username = "admin" Password = "1234" User is not blocked let username = " admin " ; let password = " 1234 " ; let isBlocked = true ; if ( username == " admin " ){ if ( password == " 1234 " ){ if ( ! isBlocked ){ console . log ( " User verified " ); } else { console . log ( " User Blocked " ); } } else { console . log ( " Not a valid password " ) } } else { console . log ( " Not a valid username " ) } O / P

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
0 views

Related Articles

News

The Tooling Layer. What Sits Around Models and Why It Matters.

Medium Programming • 3h ago

News

FlowG - Road to 1.0

Lobsters • 4h ago

Kia shows off small cars in NY: The 2027 EV3 and 2027 Seltos Hybrid
News

Kia shows off small cars in NY: The 2027 EV3 and 2027 Seltos Hybrid

Ars Technica • 4h ago

The New Era of Militia Influencers
News

The New Era of Militia Influencers

Wired • 4h ago

This Android camera accessory helped me spot a hidden electrical hazard just in time
News

This Android camera accessory helped me spot a hidden electrical hazard just in time

ZDNet • 5h ago

Discover More Articles