Basic JavaScript Functions Quiz

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

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 (B)

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

Flashcards are hidden until you start studying

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

More Like This

JavaScript Functions Quiz
5 questions

JavaScript Functions Quiz

EnviableHeliotrope7209 avatar
EnviableHeliotrope7209
Overview of Functions in JavaScript
10 questions
JavaScript Functions and Arguments Quiz
10 questions
Use Quizgecko on...
Browser
Browser