Question: Java code please * While in primary school, kids often have to generate and check * times tables-/a>. When filled in *correctly, each item in

Java code pleaseJava code please * While in primary school, kids often have to

* While in primary school, kids often have to generate and check * times tables-/a>. When filled in *correctly, each item in the array has the value of multiplying a number by *the index for that entry. So if the constant were 3, we would need to return * an array whose entries are 0, 3, 6, 9, 12, etc. This is neither interesting *nor exciting, but it is a proven way to help children learn how *multiplication works AND help CSE students learn how arrays work * @author Matthew Hertz public class MultiplicationTable [ * This returns an int array containing a multiplication table. Your method *should start by allocating an array whose length is secode numEntries Ce.g., *the second parameter). You should then set the value of each entry in the * array equal to ecode constant (e.g., the first parameter) times the index * of that entry.
* Precondition: numEntries MUST BE 0 or larger. CPRECONDITIONS SPECIFY *RESPONSIBILITIES ON A METHOD S CALLER; YOU SHOULD ASSUME THIS IS TRUE. *@param constant *@param numEntries * @return Array of the appropriate length containing the multiplication table Value whose multiplication table is to be calculated. Length of the array to be returned for @code constant!. public static int generateTable(int constant, int numEntries) 1 ta *This method checks if an array of ints contains a correctly calculated * multiplication table.
*Precondition: multTable IS NOT null. (PRECONDITIONS SPECIFY RESPONSIBILITIES *ON A METHOD'S CALLER; YOU SHOULD ASSUME THIS IS TRUE.) *@param constant *@param multTable * @return True if every entry in the array stores the value of @code constant! Value used to check the multiplication table. Table to be checked. the index for that entry; or false if at least one entry is incorrect. public static boolean checkTable(int constant, int multTable)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!