GithubHelp home page GithubHelp logo

joycemcool / javascriptbasicjavascript Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 49 KB

This is the Assignment 1 of PROG2700 course by Delano Marques, writing a collection of mini-JavaScript programs that perform a number of small computations.

License: MIT License

javascriptbasicjavascript's Introduction

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

BASIC JAVASCRIPT

this is a collection of mini-JavaScript programs that perform a number of small computations.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot

General Requirements

  • Write a function in JavaScript that will receive a string as a parameter and then perform the following:

    You don’t have to prompt for a string. Simply assign a string to a variable in your code as your starting point to use as an argument for your function.

    If the first and last characters of the string are the same (ignoring case), the function will return the string in reverse order. Otherwise, the function will return the string with the first and last letters removed. Example: “Triscuit” returns “tiucsirT” but “Cracker” returns “racke”.

    Resources: W3Schools: https://www.w3schools.com/js/js_string_methods.asp MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String

  • Write a function in JavaScript that will return the sum of the longest streak of consecutive increasing numbers within an array.

    If there are no consecutive numbers in the array, the function will return zero. If there are multiple instances of the same number of consecutive numbers (increasing by 1) in the array, the function will return the largest sum calculated between all instances. Examples: [1, 2, 3, 6, 9, 34, 2, 6] would return 6 (1+2+3) [3, 2, 7, 5, 6, 7, 3, 8, 9, 10, 23, 2, 1, 2, 3] would return 27 (8+9+10) [100, 101, 102, 3, 4, 5, 6, 9] would return 18 (3+4+5+6) Resources:
    W3Schools: https://www.w3schools.com/js/js_arrays.asp MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array

  • Write a JavaScript program to calculate the number of weeks, days, hours, minutes and seconds left until midnight on your birthday.

    The script does not have to prompt for your birthdate. Simply assign it to a variable and start from there. Ex: var myNextBirthday = …your code here Expected sample output (console.log()): There are 35 weeks, 3 days, 13 hours, 25 minutes, and 12 seconds until my next birthday! Resources:
    MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date W3Schools: https://www.w3schools.com/js/js_dates.asp

  • Write a JavaScript program to iterate through an array of ten(10) positive randomly generated numbers. Each number will then be checked to see if it’s a prime number.

    Sample Expected output (console.log()). 23-yes, 15-no, 22-no, 124-no, 11-yes, 9-no, 2-yes, 13-yes, 5-yes, 1-no

  • Instructions
    Don’t forget that a live in-person demonstration of your code is part of this assignment. You will need to show your code to the instructor in class on the due date while going through an evaluation of your code’s functionality. Part of the assessment will include your ability to speak about the code you wrote, even if it doesn’t completely work or do what you expect.

(back to top)

Built With

This section should list any major frameworks/libraries used to bootstrap your project. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
    npm install npm@latest -g

Installation

Below is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services.

  1. Get a free API Key at https://example.com
  2. Clone the repo
    git clone https://github.com/your_username_/Project-Name.git
  3. Install NPM packages
    npm install
  4. Enter your API in config.js
    const API_KEY = 'ENTER YOUR API';

(back to top)

Usage

Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.

For more examples, please refer to the Documentation

(back to top)

Roadmap

  • Add Changelog
  • Add back to top links
  • Add Additional Templates w/ Examples
  • Add "components" document to easily copy & paste sections of the readme
  • Multi-language Support
    • Chinese
    • Spanish

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Your Name - @your_twitter - [email protected]

Project Link: https://github.com/your_username/repo_name

(back to top)

Acknowledgments

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!

(back to top)

javascriptbasicjavascript's People

Contributors

joycemcool avatar

Watchers

 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.