Giter Club home page Giter Club logo

loops's Introduction

Loops

In this programming assignment you will be asked to write some loops that follow a specific behavior. Read the instructions carefully as I give hints at variables to make and how they work.

All loops should be declared inside a function with the title as the function's name.

Loop One

  • This loop should be inside the function named loopOne(){}
  • The function should have one input named time
  • Use a while-loop to create the count down program that screams every 5 seconds from the notes.
  • I am basically asking you to copy my code with one small change: use the time-variable/parameter mentioned above.

Loop Two

  • This loop should be inside a function named loopTwo(){}
  • This function performs a "Geomtric Sum"
    • 1 + 2 + 4 + 8 + 16 + ... + 2^power
    • 1 + 5 + 25 + 125 + 625 + ... + 5^power
  • This function accepts two inputs/parameters
    • number
    • power
  • At the beginning of the function, initialize a variable named sum to be zero.
  • Use a for-loop that starts at zero, stops at power, and increments by one.
  • Inside the for-loop add the number into the sum.
  • Then re-assign the number to be larger.
  • After the for-loop, return the sum variable.

Loop Three

  • This loop should be inside a function named loopThree(){}
  • This function uses a for-loop to build a pyramid with a specific symbol.

*
**
***
****
*****

  • The function has two inputs
  • symbol: which stroes the character/string to be repeated.
  • number: to indicate how far down the pyramid should go.
  • Have the for-loop console.log() the symbol. After the log, reassign the symbol to have ONE MORE symbol glued to it.
  • There is no return statement.

loops's People

Contributors

shamrockprogramming avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.