Skip to the content.

Sprint 3 review

features implemented in website:

<!DOCTYPE HTML>
<html lang="en">
<head>
    <title>Person Form</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
    <script>
        // Toggle the visibility of password fields
        function togglePasswordVisibility(fieldId, iconId) {
            var passwordField = document.getElementById(fieldId);
            var icon = document.getElementById(iconId);

            if (passwordField.type === "password") {
                passwordField.type = "text";
                icon.classList.remove("fa-eye-slash");
                icon.classList.add("fa-eye");
            } else {
                passwordField.type = "password";
                icon.classList.remove("fa-eye");
                icon.classList.add("fa-eye-slash");
            }
        }
    </script>
    <style>
        /* Styles for password visibility toggle */
        .password-container {
            position: relative;
        }
        .password-container i {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- Password and Confirm Password Fields -->
        <div class="form-group mb-2 mr-sm-2 password-container">
            <label for="password">Password:</label>
            <input type="password" id="password">
            <i class="fas fa-eye-slash" id="eye-icon-password" onclick="togglePasswordVisibility('password', 'eye-icon-password')"></i>
        </div>

        <div class="form-group mb-2 mr-sm-2 password-container confirm-password-container">
            <label for="confirm_password">Confirm Password:</label>
            <input type="password" id="confirm_password">
            <i class="fas fa-eye-slash" id="eye-icon-confirm-password" onclick="togglePasswordVisibility('confirm_password', 'eye-icon-confirm-password')"></i>
        </div>
    </div>
</body>
</html>

I wish I was able to implement more features, however I was limited in the amount of time I had to complete this because I was trying to fix the 500 error with Nandan the entire time.

MCQ Correcftions:

Q8: I selected B instead of the correct answer, C. I believe in teh moment, when I saw this, I automatically assunmed that not giving any sort of input would result in an error, however, that is not the case and answer B is correct

Q9: I dont know how I got answer C, but answer B is correct because you need to do i-1 since only i would result in an arrayindexoutofboundsexception being thrown

Q10: Once again, I dont know why I selected answer D for this. Data containing only one elemnt would worok fine in this case and should not result in an error. However, answer II does result in an error because it eventually causes an arrayindexoutofboundsexception

Q17: I meant to select C, but I must have made a mistake while doing this. The answer is 1,2,3,5,6,7,7 because the 3 gets replaced with a 7 at the end since it uses k = 3.

Q18: I could not understand the explanation, but according to Nandan, if you use math.random, you dont need to use -1 because you always get 0 or lower.

Q19: I feel like this question is designed for you to fail, it uses a triple not statement, which is extremely confusing. The correct answer for this would be B

Q23: I made this mistake of assuming x>0 instead of x>1, leading to me getting D intead of B

Q24: 24 is 7 because its rows, columns instead of me assumming it would be 2 over with the code [0][2] instead of being 2 columbs down and 0 rows over

Q28: If the value of n is 2 or less in the original call to the method mystery, the loop will be skipped and x will be 1 at //Point C.

Q36: When x is 7, y will be assigned the value 1, since 7 is odd and not greater than 9. When x is 9, y will be assigned the value 1, since 9 is odd and not greater than 9. When x is 11, y will be assigned the value 5, since 11 is odd and greater than 9. This set of values does not test the conditions when x is even and y is assigned the value 3.

Q37: I got A for this, however, III is also correct and I dont know why I got this question wrong.

Q38: I got or instead of and for this, this would always result in greatehr than 1000 or less than 1500