Почему мои оповещения не работают после моих операторов if? - PullRequest
0 голосов
/ 14 февраля 2020

Я пытался заставить мои оповещения всплывать после того, как пользователь вводил свой код лекции, но я не могу понять, что происходит.

спасибо, что уделили время!

let employeenum, firstname, surname, hours, employeecode, lecturecode

employeenum = parseInt(prompt("Please enter your Employeer Number"));

firstname = prompt("Please enter your first name");

surname = prompt("Please enter your surname");

hours = parseInt(prompt("Please enter the amount of hours worked"));

employeecode = prompt("Please enter your employee code");

if (employeecode == "L" || employeecode == "l") {
 lecturecode = parseInt(prompt("Please enter your Lecturer Qualification Code"))
   if (lecturecode == "M" || lecturecode  == "m"){
    alert("Your Pay per Hour is $575 with a teaching allowance of $2500 per month");
    }
  else if (lecturecode == "B" || lecturecode  == "b"){
    alert("Your Pay per Hour is $325 with a teaching allowance of $1250 per month");
    }
}  

1 Ответ

0 голосов
/ 14 февраля 2020

У вас есть parseInt для лекционного кода, но вы используете оператор if, ищущий письмо.

 lecturecode = prompt("Please enter your Lecturer Qualification Code")//you had parseint here
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...