Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve (fundamentals, advanced, applications, educationForm) {
- let fundamentalsP = 170
- let advancedP = 180
- let applicationsP = 190
- let price = 0
- if (fundamentals === true && advanced === true) {
- advancedP *= 0.9
- }
- if (fundamentals === true && advanced === true && applications === true) {
- price = (fundamentalsP + advancedP + applicationsP) * 0.94
- } else {
- if (fundamentals === true) {
- price += fundamentalsP
- }
- if (advanced === true) {
- price += advancedP
- }
- if (applications === true) {
- price += applicationsP
- }
- }
- if (educationForm === 'online') {
- price *= 0.94
- }
- console.log(Math.round(price))
- }
Advertisement
Add Comment
Please, Sign In to add comment