123456789101112131415161718192021222324252627282930 |
- const workingHours = 8; // Number of working hours a day
- let workingDays = +prompt("Enter working days number ", ""); // Number of working days in a month
- while (workingDays == null || workingDays == "" ) {
- alert("Working days should be a number");
- }
- let totalHoursInMonth = workingHours * workingDays;
- alert(`Your Total hours this month = ${totalHoursInMonth}`);
- let sallary = +prompt("Enter sallary you've got this month ", ""); // Sallary for month
- let rate = sallary / totalHoursInMonth; // Rate per hour
- alert(`Your rate this month was ${rate}`);
- // -----------------------------------------BLUE TASK---------------------------------------
- let login = prompt('Enter login', 'default');
- if (login == 'admin') {
- let password = prompt('Password', 'Enter password');
- if (password == 'qwerty') {
- alert('Hello Admin', "background: green;");
- } else if (password == '' || password == null) {
- alert('Wrong password');
- } else {
- alert('Cancelled');
- }
- } else if (login == null || login == '') {
- alert('Cancelled');
- } else {
- alert("Login is wrong", "background: red;");
- }
|