Question: public class CountNumbersInArray { /** Main method */ public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); System.out.print(Enter the integers between 1 and

public class CountNumbersInArray { /** Main method */ public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); System.out.print("Enter the integers between 1 and 100: ");

/* counts[1] is to keep track how many times 1 occurs. * counts[2] is to keep track how many times 1 occurs. * ... * counts[100] is to keep track how many times 1 occurs. * counts[0] is not used!!!!!! * Therefore, we need an array with 101 elements */ int[] counts = new int[101]; // TODO1: Write a WHILE loop below to get integers from user. // Increase the proper counter for each input. An input 0 ends // the loop. // Please don't over think. It is simply while not-done, keep going loop. // Refer to the slides for Ch5, Loop Categories for example code.

displayCounts(counts); } //end of main

/* * Method displayCounts: * Given an array of counts, display the count only if the count > 0 * If a count is greater than 1, the plural word "times" is used in * the output. Refer to the problem description in the word document. */ public static void displayCounts(int[] counts) { // TODO2: implenment the method body. } //end of displayCounts }

/* * See the requirement for Program 2 in the word document for this homework. * * All method bodies are default method bodies. Please figure out how * to implement each method. */

public class CurveGrades { public static void main(String[] args) { // TODO: implenment the method body. } //end of main

/* * Method nitArrayFromUserInputs: * The method will prompt user to enter the number of scores to process. * get the scores from the user, store them in an array, * and, finally, return the array. */ public static double[] getScoresInArray() { // TODO: implenment the method body. return null; } //end of getScoresInArray

/* * Method getBestScore: * Given a double array, return the highest value in the array. */ public static double getBestScore(double[] scores) { // TODO: implenment the method body. return 0.0; } //end of getBestScore /* * Method getGrade: * Given a score and the best score, return the curved grade * according to the following. * If aScore >= bestScore - 10, grade is A. * Otherise, if aScore >= bestScore - 20, grade is B. * Otherise, if aScore >= bestScore - 30, grade is C. * Otherise, if aScore >= bestScore - 40, grade is D. * Otherise, grade is F. */ public static char getGrade(double aScore, double bestScore) { // TODO: implenment the method body. return 0; } //end of getGrade }

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!