diff --git a/lesson_07/conditionals/src/lesson7.ts b/lesson_07/conditionals/src/lesson7.ts deleted file mode 100644 index 52f45df8b..000000000 --- a/lesson_07/conditionals/src/lesson7.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { computeLexicographicDistance } from "./util.js"; - -/** - * Returns true if the provided age meets the minimum US voting age and false otherwise. - * - * @param age The age to check. - * @return True if the age corresponds to a voting age and false otherwise. - */ -export function canVote(age: number): boolean { - return false; -} - -/** - * Compares two strings lexicographically. - * - * @param a The first `string` to compare. - * @param b The second `string` to compare. - * @return -1 if a is less than b, 1 if a is greater than b, and 0 otherwise. - */ -export function compareStrings(a: string, b: string): number { - // The distance will be a number less than 0 if string `a` is lexicographically less than `b`, 1 - // if it is greater, and 0 if the strings are equal. - const distance = computeLexicographicDistance(a, b); - - // TODO(you): Finish this method. - - return 0; -} - -/** - * Converts a GPA on the 4.0 scale to the corresponding letter grade using the college board - * scale. See - * https://bigfuture.collegeboard.org/plan-for-college/college-basics/how-to-convert-gpa-4.0-scale - * for details. - * - * @param gpa The GPA value. - * @return The letter grade ("A+", "A", "A-", "B+", etc.). - */ -export function convertGpaToLetterGrade(gpa: number): string { - return "F"; -} - -/** - * Computes the factorial of the given value of `n`. - * - * @param n The value for which to compute the factorial. - * @return The factorial of n. - */ -export function computeFactorial(n: number): number { - return 0; -} - -/** - * Adds all of the provided values and returns the sum. - * - * @param values The values to sum. - * @return The sum of all the values. - */ -export function addNumbers(values: number[]): number { - return 0; -} - -/** - * Returns an array of the first `n` Fibonacci numbers starting from 1. - * - * @param n The first `n` of Fibonacci values to compute. - * @return An array containing the first `n` Fibonacci values. - */ -export function getFirstNFibonacciNumbers(n: number): number[] { - return []; -} - -/** - * Finds a value in an array of values. - * - * @param values The values to search. - * @param start The left most index to search. - * @param end The right most index to search. - * @param value The value to look for. - * @return The index of the value if found in the array and -1 otherwise. - */ -export function binarySearch( - values: number[], - start: number, - end: number, - value: number, -): number { - if (end < start) { - // The range is not valid so just return -1. - return -1; - } - - const pivotIndex = Math.floor((start + end) / 2); // The index in the middle of the array. - - // TODO(you): Finish implementing this algorithm - - // If values[pivotIndex] is equal to value then return `pivotIndex`. - // Else if values[pivotIndex] is greater than the value, then - // call `binarySearch(values, start, pivotIndex - 1, value)` and return its value; - // Else call `binarySearch(values, pivotIndex + 1, end, value)` and return its value. - return -1; -} diff --git a/lesson_09/types/types_app/src/main/java/com/codedifferently/lesson9/dataprovider/NileJackProvider.java b/lesson_09/types/types_app/src/main/java/com/codedifferently/lesson9/dataprovider/NileJackProvider.java new file mode 100644 index 000000000..437665660 --- /dev/null +++ b/lesson_09/types/types_app/src/main/java/com/codedifferently/lesson9/dataprovider/NileJackProvider.java @@ -0,0 +1,22 @@ +package com.codedifferently.lesson9.dataprovider; + +import java.util.Map; +import org.springframework.stereotype.Service; + +@Service +public class AnthonyMaysProvider extends DataProvider { + public String getProviderName() { + return "anthonymays"; + } + + public Map getColumnTypeByName() { + return Map.of( + "column1", Integer.class, + "column2", String.class, + "column3", Boolean.class, + "column4", Float.class, + "column5", Double.class, + "column6", Long.class, + "column7", Short.class); + } +}