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/resources/data/nilejack.json b/lesson_09/types/types_app/src/main/resources/data/nilejack.json new file mode 100644 index 000000000..9f1d4b901 --- /dev/null +++ b/lesson_09/types/types_app/src/main/resources/data/nilejack.json @@ -0,0 +1,93 @@ +[ + import public class NileJackProvider + { + "column1", Float.class, + "column2", Integer.class, + "column3", String.class, + "column4", BigInt.class, + "column5", Double.class, + "column6", Long.class, + "column7", Boolean.class, + }, + { + "column1": "2.9846927E38", + "column2": "31547", + "column3": "zvpsy", + "column4": "1389365663", + "column5": "1.3568212826887597E308", + "column6": "2903269341198776320", + "column7": "false" + }, + { + "column1": "1.1708629E38", + "column2": "9758", + "column3": "x56kiqsfhrmt", + "column4": "1291411059", + "column5": "1.4310658144532972E308", + "column6": "5349308225575656448", + "column7": "false" + }, + { + "column1": "3.2003028E38", + "column2": "23236", + "column3": "hx0697rd", + "column4": "1021569000", + "column5": "1.1812029695991776E308", + "column6": "1365447698897773824", + "column7": "true" + }, + { + "column1": "3.053783E38", + "column2": "16064", + "column3": "1t2kcbn", + "column4": "1769933788", + "column5": "1.0575584058025185E308", + "column6": "583048624730695808", + "column7": "true" + }, + { + "column1": "1.4229291E38", + "column2": "20556", + "column3": "hqr8pxa6ucm", + "column4": "193767786", + "column5": "1.4200091587041463E308", + "column6": "3109639796338298880", + "column7": "true" + }, + { + "column1": "2.3684926E38", + "column2": "21334", + "column3": "tzwg6029q4", + "column4": "798768748", + "column5": "1.1297514119866057E308", + "column6": "8042224530499211264", + "column7": "false" + }, + { + "column1": "1.9054222E38", + "column2": "32440", + "column3": "f2hdjptoz8w", + "column4": "836789060", + "column5": "1.2026069923035651E307", + "column6": "5325813815938213888", + "column7": "false" + }, + { + "column1": "2.4662948E38", + "column2": "9223", + "column3": "di6w3a9n", + "column4": "1299327748", + "column5": "1.45235568521045E307", + "column6": "6142717168008359936", + "column7": "false" + }, + { + "column1": "3.1097544E38", + "column2": "1379", + "column3": "cusq2kb", + "column4": "908268505", + "column5": "3.473809269036574E306", + "column6": "7500801420007482368", + "column7": "false" + } +] \ No newline at end of file