Giter Club home page Giter Club logo

operations's Introduction

TASK FOR VS FOR-In try to write a the following loop with while and do-while: for (var i = 0; i < a.length; i++) { console.log("for", i, a[i]); } https://github.com/Gayane25/lesson004_Operations/blob/master/taskForWhile.js

TASK 1 Given a number. Print “odd” if the number is odd and “even” if itʼs even. Input / Output 125/ “odd” 20 / “even” https://github.com/Gayane25/lesson004_Operations/blob/master/ex1OddEven.js

TASK 2 Given two variables, which are the angles of a triangle. Find the third angle of the triangle. (Sum of the angles of a triangle equals 180 degrees). Input / Output 45, 90 / 45 30, 30 / 120 https://github.com/Gayane25/lesson004_Operations/blob/master/ex2Triangle.js

TASK 3 Given a positive integer. Bring the last digit of the number to the beginning. Print the new number. If the last digit of the inserted number is 0, number remains the same. Input / Output 367 / 736 1002 / 2100 https://github.com/Gayane25/lesson004_Operations/blob/master/ex3lastToBeg.js

TASK 4 Check if a number is a multiple of 3, 5 or 7 and output the appropriate message. Input / Output 21 /“21 is a multiple of 3 and 7.” 35 / “35 is a multiple of 5 and 7.“ 13 /“13 is not a multiple of 3, 5 or 7.” 420 / “420 is a multiple of 3, 5 and 7.” 24 / “24 is a multiple of 3.” https://github.com/Gayane25/lesson004_Operations/blob/master/ex4_multiple.js

TASK 5 Given three numbers. Sort them by the ascending order. Input / Output 45 , 26, 78 / 26, 45, 78 https://github.com/Gayane25/lesson004_Operations/blob/master/ex5_ascending.js

TASK 6 Find the sign of product of three numbers without multiplication operator. Display the specified sign. https://github.com/Gayane25/lesson004_Operations/blob/master/ex6_prodSign.js

TASK 7 Insert a digit and a number. Check whether the digits contains in the number or not. https://github.com/Gayane25/lesson004_Operations/blob/master/ex7_digContains.js

TASK 8 Enter a number. Reverse its first and last digits. Print the new number. https://github.com/Gayane25/lesson004_Operations/blob/master/ex8_reversed.js

TASK 10 Given a number n ( n >= 0 ) . Print n Fibonacci number. (Fibonacci th series: 0, 1, 1, 2, 3, 5, 8 ..., ak = ak-1 + ak-2) https://github.com/Gayane25/lesson004_Operations/blob/master/ex10fibonacci.js

TASK 11 Insert a number. Calculate product and sum of the digits of the number. If product is divisible by the sum, print the quotient, otherwise print the remainder. https://github.com/Gayane25/lesson004_Operations/blob/master/ex11_quotient.js

TASK 12 Given a sentence with missing words and an array of words. Replace all ‘_ʼ in a sentence with the words from the array. https://github.com/Gayane25/lesson004_Operations/blob/master/ex12_MissingWords.js

TASK 13 Given mixed array of numbers, strings, booleans, nulls and undefined. Filter array and get all thenumbers in a separate array. Arrange them such as from the beginning are the odds and from the ending the evens. https://github.com/Gayane25/lesson004_Operations/blob/master/ex13_mixedArr.js

TASK 14 Given an array of strings and numbers. Print the number of integers and the number of strings in the array. https://github.com/Gayane25/lesson004_Operations/blob/master/ex14_sumStr.js

TASK 15 Given an array of strings. Find the strings with maximum and minimum lengths in array. Print the sum of their lengths. https://github.com/Gayane25/lesson004_Operations/blob/master/ex15_maxMinSum.js

TASK 16 Given an array of numbers and a number. Find the index of a first element which is equal to that number. If there is not such a number, that find the index of the first element which is the closest to it. https://github.com/Gayane25/lesson004_Operations/blob/master/ex16_equalNum.js

TASK 17 Given a sentence as a string. Split it according to space and comma and create an array consisting of the words of the array. The last word should not contain the last . or ! . https://github.com/Gayane25/lesson004_Operations/blob/master/ex17_strSplice.js

TASK 19 Given an array consisting from the arrays of numbers (like a two-dimensional array). Find sum of each row and print them as an array. https://github.com/Gayane25/lesson004_Operations/blob/master/ex19_nestedArr.js

OPTIONAL TASK 1 Enter a number. Find the difference between its biggest and smallest digits. https://github.com/Gayane25/lesson004_Operations/blob/master/optionalTask.js

OPTIONAL TASK 4 Enter a positive number. Calculate and print its factorial. ( n! = n _ (n-1) _ (n-2) _ ... _ 3 _ 2 _ 1 , 0! = 1 ) https://github.com/Gayane25/lesson004_Operations/blob/master/optionalTask4.js

operations's People

Contributors

gayane25 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.