Advertisement · 728 × 90
#
Hashtag
#8kyu
Advertisement · 728 × 90
List display with button to add numbers and reset

List display with button to add numbers and reset

HTML code

HTML code

JavaScript code

JavaScript code

JavaScript code

JavaScript code

8kyu Codewars List Challenge. This was fun. I wonder… could I make a text adventure game?🤔 #codewars #8kyu #WebDevelopment #Frontend #DevCommunity #Coding

1 0 0 0
Image of the grading rubric: under the rubric are two input boxes for grades and projects, and under that is the calculate button.

Image of the grading rubric: under the rubric are two input boxes for grades and projects, and under that is the calculate button.

HTML Code

HTML Code

Javascript code

Javascript code

Completed 8kyu Codewars Grading Rubric Challenge #codewars #8kyu #WebDevelopment #Frontend #DevCommunity #Coding

2 0 0 0
Preview
Student's Final Grade ### _Instructions:_ Create a function finalGrade, which calculates the final grade of a student depending on two parameters: a grade for the exam and a number of completed projects. This function should take two arguments: exam - grade for exam (from 0 to 100); projects - number of completed projects (from 0 and above); This function should return a number (final grade). There are four types of final grades: 100, if a grade for the exam is more than 90 or if a number of completed projects more than 10. 90, if a grade for the exam is more than 75 and if a number of completed projects is minimum 5. 75, if a grade for the exam is more than 50 and if a number of completed projects is minimum 2. 0, in other cases Examples(Inputs-->Output): 100, 12 --> 100 99, 0 --> 100 10, 15 --> 100 85, 5 --> 90 55, 3 --> 75 55, 0 --> 0 20, 2 --> 0 ### _Thoughts:_ 1.I use the if/else statement to determine the return of the final grade function of different conditions. 2.Inside the if/else statement I use short circuit || and && based on the requirements from the instructions. ### _Solution:_ function finalGrade (exam, projects) { if(exam > 90 || projects > 10) return 100; if(exam > 75 & projects >= 5) return 90; if(exam > 50 & projects >= 2) return 75; return 0; } This is a CodeWars Challenge of 8kyu Rank
0 0 0 0
Preview
If you can't sleep, just count sheep!! _Instructions:_ If you can't sleep, just count sheeps!! Task: Given a non-negative integer, 3 for example, return a string with a murmur: "1 sheep...2 sheep...3 sheep...". Input will always be valid, i.e. no negative integers. _Thoughts:_ 1.I define a variable murmur outside of the for loop, to be able to use it after the loop block. 1. I define a for loop as I do not know the num parameter. Inside the for loop, I add to the murmur variable the number i and the string sheep... . This addition is keep happening until the number i will be equal with number num. _Solution:_ var countSheep = function (num){ let murmur = ''; for(let i= 1; i <= num; i++){ murmur += i + ' sheep...' } return murmur; } This is a CodeWars Challenge of 8kyu Rank (https://www.codewars.com/kata/5b077ebdaf15be5c7f000077/train/javascript)
0 0 0 0
Preview
Remove String Spaces _Instructions:_ Write a function that removes the spaces from the string, then return the resultant string. Examples (Input -> Output): "8 j 8 mBliB8g imjB8B8 jl B" -> "8j8mBliB8gimjB8B8jlB" "8 8 Bi fk8h B 8 BB8B B B B888 c hl8 BhB fd" -> "88Bifk8hB8BB8BBBB888chl8BhBfd" "8aaaaa dddd r " -> "8aaaaaddddr" _Thoughts:_ Using the replace() method with a regular expression (/\s/g) to match all whitespace characters. This is a CodeWars Challenge of 8kyu Rank (https://www.codewars.com/kata/57eae20f5500ad98e50002c5/train/javascript)
0 0 0 0
Preview
Remove String Spaces _Instructions:_ Write a function that removes the spaces from the string, then return the resultant string. Examples (Input -> Output): "8 j 8 mBliB8g imjB8B8 jl B" -> "8j8mBliB8gimjB8B8jlB" "8 8 Bi fk8h B 8 BB8B B B B888 c hl8 BhB fd" -> "88Bifk8hB8BB8BBBB888chl8BhBfd" "8aaaaa dddd r " -> "8aaaaaddddr" _Thoughts:_ Using the replace() method with a regular expression (/\s/g) to match all whitespace characters. This is a CodeWars Challenge of 8kyu Rank (https://www.codewars.com/kata/57eae20f5500ad98e50002c5/train/javascript)
0 0 0 0