The document provides 3 tasks to complete in Java and 2 SQL queries to write based on an order table schema. The Java tasks are: 1) Implement a method to return the sum of the two largest elements in an array, 2) Implement a method to return the element closest to zero in an array, and 3) Write a program to list the first 1500 natural numbers with factors of only 2, 3, or 5 within 2 minutes. The SQL queries are: 1) Write a query to search for the latest order with quantity greater than X, and 2) Write a query to list the number of orders each customer has made.
The document provides 3 tasks to complete in Java and 2 SQL queries to write based on an order table schema. The Java tasks are: 1) Implement a method to return the sum of the two largest elements in an array, 2) Implement a method to return the element closest to zero in an array, and 3) Write a program to list the first 1500 natural numbers with factors of only 2, 3, or 5 within 2 minutes. The SQL queries are: 1) Write a query to search for the latest order with quantity greater than X, and 2) Write a query to list the number of orders each customer has made.
The document provides 3 tasks to complete in Java and 2 SQL queries to write based on an order table schema. The Java tasks are: 1) Implement a method to return the sum of the two largest elements in an array, 2) Implement a method to return the element closest to zero in an array, and 3) Write a program to list the first 1500 natural numbers with factors of only 2, 3, or 5 within 2 minutes. The SQL queries are: 1) Write a query to search for the latest order with quantity greater than X, and 2) Write a query to list the number of orders each customer has made.
The document provides 3 tasks to complete in Java and 2 SQL queries to write based on an order table schema. The Java tasks are: 1) Implement a method to return the sum of the two largest elements in an array, 2) Implement a method to return the element closest to zero in an array, and 3) Write a program to list the first 1500 natural numbers with factors of only 2, 3, or 5 within 2 minutes. The SQL queries are: 1) Write a query to search for the latest order with quantity greater than X, and 2) Write a query to list the number of orders each customer has made.
public static int sumOfTwoLargestElements(int[] a) { /* Please implement this method to return the sum of the two largest integer numbers in a given array. */ }
2. I mpl ement t he f ol l owi ng f unct i on public static int getClosestToZero(int[] a) { /* Please implement this method to return the integer number in a given array that is closest to zero. If there are two equally closest to zero elements like 2 and -2 consider the positive element, i.e. 2, to be "closer" to zero. */ }
3. Wr i t e a J ava pr ogr amt o l i st out t he first 1500 natural numbers whose f act or ( s) i s/ ar e ei t her ONLY 2, 3, or 5. The f ast er your pr ogr am can compl et e t he cal cul at i on t he bet t er , but i t shoul d not r un mor e t han 2 minute.
For your r ef er ence, t he f i r st 20 number s ar e ( f act or s l i st ed af t er semi col on) :
PS: 21 (3*7), 22 (2*11), 26 (2*13) are numbers that should not be in the list. SQL 1. Quest i on 2 & 3 wi l l based on t he f ol l owi ng t abl e schema: or der _i d NUMBER cust omer _name VARCHAR or der _dat e DATE quant i t y NUMBER 2. Pl ease wr i t e a SQL quer y t o sear ch f or t he l at est or der wi t h quant i t y l ar ger t han X. 3. Pl ease wr i t e a SQL quer y t o l i st down f or each cust omer how many or der s t hey have made r espect i vel y.