public class ReviewQ3 { public static void main(String[] args) { double[][] x = new double[][]{{45,5,6,4,1,9,4,4}, {2,6,3,4,5,5,6,3}, {2,3,4,5,6,7,8,9}}; printArray(x); selectSortByRows(x); printArray(x); selectSortByCols(x); printArray(x); } /** Print 2-d array x */ public static void printArray(double[][] x) { } /** = sum of 1-d array */ public static double rowSum(double[] array) { } /** = sum of column j in 2-d array */ public static double colSum(double array[][], int j) { } /** Select sort 2-d array such that row sums are in ascending order */ public static void selectSortByRows(double[][] array){ } //method selectSortByRows /** Select sort 2-d array such that column sums are in ascending order */ public static void selectSortByCols(double[][] array){ } //method selectSortByCols } //class ReviewQ3
I loVE prOgramminghas the following vowel frequencies:
a e i o u 1 1 2 2 0
QWE_RTYUIOPASDFGHJKLZXCVBNM
, then the sentence A_DAB
will be encrypted as QM_QW
.
/** = Return a char array containing the encrypted sentence. Encrypt sentence s using array key */ public static char[] encrypt(char[] s, char[] key)Note: Do not create a
String
or char
array containing the alphabet (the 26 letters in order) in your code. Do not use any pre-defined methods.
main
method, perhaps with some static function(s) for clarity/conciseness), or OO programming (define classes with fields and methods).