Skip to content

Michiah/LogicDrilz01

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The Barons Logic Drillz

Part 1

Problem 01

    /**
     * Problem 01: Sleeping In
     * The parameter weekday is true if it is a weekday,
     * and the parameter vacation is true if we are on vacation.
     * We sleep in if it is not a weekday or we're on vacation.
     * Return true if we sleep in.
     * @param weekday
     * @param vacation
     * @return
     */
    public boolean sleepIn(boolean weekday, boolean vacation) {
        return false;
    }

Problem 02

    /**
     * Problem 02: diff21
     * Given an int n, return the absolute difference between n and 21,
     * except return double the absolute difference if n is over 21.
     * @param n
     * @return
     */
    public int diff21(int n) {
        return 0;
    }

Problem 03

    /**
     * Problem 03: Near Hundred
     * Given an int n, return true if it is within 10 of 100 or 200.
     * Note: Math.abs(num) computes the absolute value of a number.
     * @param n
     * @return
     */
    public boolean nearHundred(int n) {
        return false;
    }

Problem 04

    /**
     * Problem 04 : Has Teen
     * We'll say that a number is "teen" if it is in the range 13..19 inclusive.
     * Given 3 int values, return true if 1 or more of them are teen.
     * @param input
     * @return
     */
    public boolean hasTeen(int[] input) {
        return false;
    }

Problem 05

    /**
     * Problem 05 : String Match
     * Given 2 strings, a and b, return the number of the positions where
     * they contain the same length 2 substring.
     * So "xxcaazz" and "xxbaaz" yields 3, since the "xx", "aa", and "az"
     * substrings appear in the same place in both strings.
     * @param a
     * @param b
     * @return
     */
    public int stringMatch(String a, String b) {
        return 0;
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%