Giter Club home page Giter Club logo

numberloops-java's Introduction

NumberUtilities

  • Ensure each of the test cases in the class NumberUtilitiesTest successfully passes upon completion of each of the method stubs in the class NumberUtilities.
    • String getEvenNumbers(int start, int stop)
    • String getOddNumbers(int start, int stop)
    • String getSquareNumbers(int start, int stop, int step)
    • String getRange(int start, int stop, int step)
    • String getExponentiations(int start, int stop, int step, int exponent)





String getRange(int stop)

  • Description
    • Given an integer, stop, return a String concatenation of all integers between 0 up to and not including stop.

Example

  • Sample Script

    // : Given
    int stop = 11;
    
    // : When
    String outcome = NumberUtilities.getRange(stop);
    
    // : Then
    System.out.println(outcome);
    
  • Sample Output

    012345678910
    





String getRange(int start, int stop)

  • Description
    • Given two integers, start, and stop, return a String concatenation of all integers between start up to and not including stop.

Example

  • Sample Script

    // : Given
    int start = 5;
    int stop = 11;
    
    // : When
    String outcome = NumberUtilities.getRange(start, stop);
    
    // : Then
    System.out.println(outcome);
    
  • Sample Output

    5678910
    





String getRange(int start, int stop, int step)

  • Description
    • Given three integers, start, stop, and step return a String concatenation of all integers between start, incrementing by step, up to and not including stop.

Example

  • Sample Script

    // : Given
    int start = 5;
    int stop = 20;
    int step = 5;
    
    // : When
    String outcome = NumberUtilities.getRange(min, max, step);
    
    // : Then
    System.out.println(outcome);
    
  • Sample Output

    51015
    





String getEvenNumbers(int start, int stop)

  • Description
    • Given two integers, start, and stop, return a String concatenation of all even integers between start up to and not including stop.

Example

  • Sample Script

    // : Given
    int start = 5;
    int stop = 20;
    
    // : When
    String outcome = NumberUtilities.getOddNumbers(min, max);
    
    // : Then
    System.out.println(outcome);
    
  • Sample Output

    681012141618
    





String getOddNumbers(int start, int stop)

  • Description
    • Given two integers, start, and stop, return a String concatenation of all even integers between start up to and not including stop.

Example

  • Sample Script

    // : Given
    int start = 5;
    int stop = 20;
    
    // : When
    String outcome = NumberUtilities.getOddNumbers(min, max);
    
    // : Then
    System.out.println(outcome);
    
  • Sample Output

    5791113151719
    





String getSquareNumbers(int start, int stop)

  • Description
    • Given two integers, start, and stop, return a String concatenation of all values squared between start up to and not including stop.

Example

  • Sample Script

    // : Given
    int start = 5;
    int stop = 20;
    
    // : When
    String outcome = NumberUtilities.getOddNumbers(min, max);
    
    // : Then
    System.out.println(outcome);
    
  • Sample Output

    25100225
    





String getExponentiations(int start, int stop, int step, int exponent)

  • Description
    • Given four integers, start, stop, step, and exponent, return a String concatenation of all values, raised to the specified exponent, between start up to and not including stop, incrementing by the specified step.

Example

  • Sample Script

    // : Given
    int start = 5;
    int stop = 20;
    int step = 5;
    int exponent = 2;
    
    // : When
    String outcome = NumberUtilities.getOddNumbers(min, max);
    
    // : Then
    System.out.println(outcome);
    
  • Sample Output

    25100225
    

numberloops-java's People

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.