Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Scholarship(input) {
- let dohod = Number(input.shift());
- let avGrade = Number(input.shift());
- let minZapl = Number(input.shift());
- let socScholarship = 0;
- let gradeScholarship = 0;
- if (dohod < minZapl) {
- if (avGrade > 4.5) {
- socScholarship = minZapl * 0.35;
- }
- }
- if (avGrade >= 5.50) {
- gradeScholarship = avGrade * 25;
- }
- if (socScholarship > gradeScholarship) {
- console.log(`You get a Social scholarship ${Math.floor(socScholarship)} BGN`);
- }
- else if (gradeScholarship > socScholarship) {
- console.log(`You get a scholarship for excellent results ${Math.floor(gradeScholarship)} BGN`);
- }
- else {
- console.log(`You cannot get a scholarship!`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement