Giter VIP home page Giter VIP logo

java-csd-starter-nov-17's Introduction

User Stories

As a tennis player I want to make reservation online, so that I can start playing when I arrive.

As a tennis player I want to find the nearest court around my area, so that I can save time.

As a premium member I can set up recurring reservations for practices so that I don’t need to set up repeatedly.

As a tennis player I want to send the reservation information to my partner, so that he/she can arrive on time.

As a court manager, I want to publish the available hours and fee rates of my courts, so that my customers can make reservation.

As a court manager, I want to collect reservation fee.

Environment & Tools

JDK 8

IntelliJ

git

Maven

package kata;

import org.junit.Test;

import static junit.framework.TestCase.assertEquals;

public class TranslatorTest {
    @Test
    public void pig_latin_rules() {
        assertEquals("appleway", toPigLatin("apple"));
        assertEquals("ananabay", toPigLatin("banana"));
        assertEquals("Appleway", toPigLatin("Apple"));
        assertEquals("Ananabay", toPigLatin("Banana"));
    }

    String toPigLatin(String input) {
        if ("aeiouyAEIOUY".contains(((Character) input.charAt(0)).toString())) {
            return input + "way";
        }

        int index = 0;
        for (int i = 0; i < input.length(); i++) {
            if ("aeiouyAEIOUY".contains(((Character) input.charAt(i)).toString())) {
                index = i;
                break;
            }
        }

        String a = input.substring(index);
        String b = input.substring(0, index).toLowerCase();

        String result = a + b + "ay";

        if (Character.isUpperCase(input.charAt(0))) {
            String word = result;
            Character ch = Character.toUpperCase(word.charAt(0));
            word = ch + word.substring(1);
            result = word;
        }

        return result;
    }

}
mvn install -DskipTests

java-csd-starter-nov-17's People

Contributors

yuanmai avatar

Watchers

 avatar James Cloos avatar  avatar george 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.