Skip to content

armeagle777/homework-conditional-operators-loops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

Conditional operators | Loops

Source

Classroom-tasks
@@@
Home-tasks
Print 'Odd' || 'Even' Given a number. Print “odd” if the number is odd and “even” if itʼs even.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/printOddEven.js
Find the third angle 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).
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/triangle.js
Last digit to the beginning 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.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/lastDigitToBeginning.js
If a number is a multiple of 3, 5, 7 Check if a number is a multiple of 3, 5 or 7 and output the appropriate message.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/multiple.js
Sort numbers Given three numbers. Sort them by the ascending order.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/orderAsc.js
Find the sign of product of numbers Find the sign of product of three numbers without multiplication operator. Display the specified sign.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/signOfProduct.js
Check whether the number contains digits Insert a digit and a number. Check whether the digits contains in the number or not.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/checkIfContains.js
Reverse first and last digits of a number Enter a number. Reverse its first and last digits. Print the new number.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/reversedigits.js
Is number prime or not? Insert a number. Print ‘yesʼ if the number is prime, ‘noʼ otherwise.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/isNumberPrime.js
Fibonacci 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/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/fibonacci.js
Product and sum of digits of a number 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/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/sumOfDigits.js
Replace '_' signs of a sentence 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/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/replaceBlankedFromArray.js
Filter and sort an array Given mixed array of numbers, strings, booleans, nulls and undefined. Filter array and get all the numbers in a separate array. Arrange them such as from the beginning are the odds and from the ending the evens.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/filterAndSortArrays.js
Count of string and numbers in an array Given an array of strings and numbers. Print the number of integers and the number of strings in the array.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/numOfStringsIntegers.js
Strings with maximum and minimum length in an array Given an array of strings. Find the strings with maximum and minimum lengths in array. Print the sum of their lengths.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/stringLength.js
Index of a number in an array 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/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/indexOfNumber.js
Split a string into an array 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/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/stringIntoArray.js
Create an array from element of the given array Given an array of a size smaller than 100. It consists of numbers from 0 to 99 in any order. Create a new array where each element from that array is placed under the index of its value. Start from the smallest value and end with the biggest one. If there are missing values, put in its places undefined.
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/replaceIndexToValue.js
Two-dimenstional array 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/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/sumOfRows.js
Print pattern Print the following pattern:
https://github.com/armeagle777/objects-and-arrays/blob/master/homeTasks/requiredTasks/pattern.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published