Personalized project reference

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/13

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

14 Terms

1
New cards
2
New cards
3
New cards
  1. My program is designed for students who are just beginning to study computer science or related fields. One common need for this user is to understand technical acronyms, which can be confusing at first. To meet this need, my program uses a flashcard game structure that makes learning acronyms easier to memorize. The design includes immediate feedback after every step the user does while playing, making the experience fun and with a supportive environment.

Question 1

4
New cards
5
New cards
  1. The first iteration statement I used is in my countCorrectAnswers() procedure. The loop runs (var i = 0; i < userAnswers.length; i++), which means it executes once each answer the user gave. Since the number of acronyms is fixed (12), the loop runs 12 times (once per acronym).
6
New cards

A condition that would cause this loop to not terminate and lead to an infinite loop would be if I accidentally forgot to update i inside the loop like writing for (var i=0; i < userAnswers.length;). Without i++, i would never increase, and the loop would keep checking the same index forever.

7
New cards
8
New cards
  1. The procedure checkAnswers(userAnswer, index) is where users’ answers are checked against the correct ones. A possible error is if the index goes beyond the bounds of the meanings, which doesn’t exist. This could happen if currentIndex is not reset or if the user somehow clicks a button too many times.
9
New cards

To test this, I would try entering answers until the end of the quiz and see if any errors pop up in the console. I also use feedback like “Incorrect. The correct answer was: “ + correctAnswer to make sure the answer displayed actually matches the user’s question.

10
New cards
11
New cards
  1. I used the list userAnswers to store whether each answer was correct or not. This is important because it helps me manage the user’s progress and performance without having to create 12 separate variables like answer1Correct, answer2Correct, and so on.
12
New cards

This list is used later in the countCorrectAnswers() function to calculate how many answers the user got right. The loop goes through the list and adds one to the count every time isEqual(userAnswers[i], true) returns true. This lets me easily give the user their final score in a flexible, dynamic way, even if I later decided to add more questions.

13
New cards
14
New cards