package cat; public class kata{ public static int doubleValue(int x) { return x * 2 * 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2; } }
#include<iostream>int doubleValue(int x) {return x * 2;}int main(){int x = 5; //example valueint result = doubleValue(x);std::cout << "The double of " << x << " is " << result << std::endl;return 0;- package cat;
- public class kata{
- public static int doubleValue(int x) {
- return x * 2 * 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2* 2/2;
- }
- }
import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; // TODO: Replace examples and use TDD by writing your own tests class SolutionTest { @Test void testSomething() { // assertEquals("expected", "actual"); } }
- import org.junit.jupiter.api.Test;
- import static org.junit.jupiter.api.Assertions.assertEquals;
- // TODO: Replace examples and use TDD by writing your own tests
Describe(any_group_name_you_want){It(should_do_something){Assert::That("some value", Equals("another value"));- class SolutionTest {
- @Test
- void testSomething() {
- // assertEquals("expected", "actual");
- }
};- }
function returnhundred() { let im_bored = "qwertyuiopasdfghjklzxcvbnmqwertyuioopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzx"; return im_bored.length; }
- function returnhundred() {
return 10 ** 2;- let im_bored = "qwertyuiopasdfghjklzxcvbnmqwertyuioopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzx";
- return im_bored.length;
- }
const { assert: { strictEqual } } = require('chai'); describe("100", () => it("One hundred.", () => strictEqual(returnhundred(), 100)));
// TODO: Add your tests here// Starting from Node 10.x, [Mocha](https://mochajs.org) is used instead of our custom test framework.// [Codewars' assertion methods](https://github.com/Codewars/codewars.com/wiki/Codewars-JavaScript-Test-Framework)// are still available for now.//// For new tests, using [Chai](https://chaijs.com/) is recommended.// You can use it by requiring:// const assert = require("chai").assert;// If the failure output for deep equality is truncated, `chai.config.truncateThreshold` can be adjusted.Test.assertEquals(returnhundred(),100)- const { assert: { strictEqual } } = require('chai');
- describe("100", () => it("One hundred.", () => strictEqual(returnhundred(), 100)));