Basic JavaScript Functions Quiz
6 Questions
100 Views

Basic JavaScript Functions Quiz

Created by
@SustainableAntigorite1088

Questions and Answers

What does the function in '5.1.4: Do You Have a Dog?' check?

  • If the user has a dog (correct)
  • User's age
  • Whether the user is logged in (correct)
  • If the user has a cat
  • What is the output of the function in '5.2.6: Can You Graduate?' when both conditions are true?

    Can be graduated: true

    In '5.2.7: School's Out', if today is a holiday, the output will indicate that school is in session.

    False

    What determines if doubles were rolled in '5.3.5: Rolling Dice'?

    <p>diceOne == diceTwo</p> Signup and view all the answers

    In '5.3.6: Girl Scout Designation', a user achieves gold status if they sell _____ boxes or meet other criteria.

    <p>100</p> Signup and view all the answers

    What is the age range for teenagers in the function from '5.4.7: Teenagers'?

    <p>13 and older</p> Signup and view all the answers

    Study Notes

    Do You Have a Dog?

    • Defines a function named start that initializes a variable loggedIn as true.
    • Outputs a statement asking if the user has a dog along with the logged-in status.

    Can You Graduate?

    • Contains a function start to determine graduation eligibility based on credits and requirements.
    • Utilizes readBoolean to get user input for credit status and requirement fulfillment.
    • Computes if the user can graduate by checking if both conditions are true.

    School's Out

    • The function start checks if it is a holiday and whether it is a weekday.
    • Uses logical operators to evaluate the status of school based on the day being a holiday or a weekday.
    • Outputs whether school is in session or if it is a holiday.

    Rolling Dice

    • Defines a function start that solicits two dice rolls from the user.
    • Checks if the first and the second die rolls are equal, indicating doubles.
    • Prints a statement indicating whether doubles were rolled based on user input.

    Girl Scout Designation

    • The start function evaluates if a user qualifies for a "gold status" as a Girl Scout.
    • Takes inputs for boxes sold, badges earned, and hours volunteered using readInt.
    • Conditions include selling a minimum number of boxes, earning a certain number of badges, and volunteering for specified hours.

    Teenagers

    • Implements a function start that checks if a given age falls within the teenage range.
    • Evaluates if the age is 13 or greater and less than the upper teenage age.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    Test your knowledge of basic JavaScript functions through various scenarios, including checking dog ownership, graduation eligibility, holiday status, and dice rolls. Each question evaluates your understanding of how functions can process user input and logical conditions.

    More Quizzes Like This

    Use Quizgecko on...
    Browser
    Browser