Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let doxod = Number(input.shift())
- let uspeh = Number(input.shift())
- let zaplata = Number(input.shift())
- let stipendia = 0
- let stipendiaUspeh = 0
- if (doxod <= zaplata && uspeh >= 4.50) {
- stipendia = (zaplata * 0.35)
- }
- if (uspeh >= 5.5) {
- stipendiaUspeh = uspeh * 25
- }
- if (stipendia < stipendiaUspeh) {
- console.log (`You get a scholarship for excellent results ${stipendiaUspeh.toFixed(0)} BGN`)
- }
- else if (stipendiaUspeh < stipendia) {
- console.log (`You get a Social scholarship ${stipendia.toFixed(0)} BGN`)
- }
- else {
- console.log ("You cannot get a scholarship!")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement