Java Question Method and 1 dimension arrays![(20) YouTube ㄨ Electronics, Cars, Fashion, Co × Upload Assignment: Program xy 9 Program3.pdf eduardo C Secure https://blackboard.kean.edu/bbcswebdav/pid-736390-dt-content-rid-2804166 1/courses/18SP CPS 2231 06/Program3.pdf Concepts: Methods and one dimensional Arrays Point value: 45 points Write a Java Class that reads students grades and assigns grades based on the following grading curve .Grade is A if the score is greater than or equal to the highest score - 10 .Grade is B if the score is greater than or equal to the highest score -20 Grade is C if the score is greater than or equal to the highest score 30 Grade is D if the score is greater than or equal to the highest score 40 Grade is F otherwise So, for example, after all grades are entered, if the highest grade entered was a 92, then: A >= 82 B>= 72 .D52 F otherwise The program will do the following: Prompt the user for the number of grades to be entered. The grades will all be integers. .Read in the grades and store them in an array of the correct size. Call the method below (which you will create) to calculate and return the highest value in the Array public static int findMax(int[] theArray) .Call the method below (which you will create) to print a line for each grade in the format displayed in the sample output on next page public static void printGrades (int[] theArray, int highestGrade)](http://img.homeworklib.com/questions/59a15030-bf86-11ea-9ba5-7f7ae9f419b4.png?x-oss-process=image/resize,w_560)

Please find my implementation.
import java.util.Scanner;
public class Grade {
public static int findMax(int[] theArray) {
int max = theArray[0];
for(int i=1; i<theArray.length; i++)
if(theArray[i] > max)
max = theArray[i];
return max;
}
public static void printGrades(int[] theArray, int higestGrade) {
for(int i=0; i<theArray.length; i++) {
char ltr;
if(theArray[i] >= Math.abs(higestGrade- 10))
ltr = 'A';
else if(theArray[i] >= Math.abs(higestGrade - 20))
ltr = 'B';
else if(theArray[i] >= Math.abs(higestGrade - 30))
ltr = 'C';
else if(theArray[i] >= Math.abs(higestGrade - 40))
ltr = 'D';
else
ltr = 'F';
System.out.println("Student "+i+" score is "+theArray[i]+" and grade is "+ltr);
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of grades");
int n = sc.nextInt();
// creating an array
int[] grades = new int[n];
// reading grades
System.out.println("Enter 4 grades separated by space");
for(int i=0; i<n; i++)
grades[i] = sc.nextInt();
sc.close();
int max = findMax(grades);
//System.out.println(max);
printGrades(grades, max);
}
}
/*
Sample run:
Enter the number of grades
4
Enter 4 grades separated by space
40 55 70 58
Student 0 score is 40 and grade is C
Student 1 score is 55 and grade is B
Student 2 score is 70 and grade is A
Student 3 score is 58 and grade is B
*/
![タR Markers Properties悦Servers?Data Source Explorer S snippets R Problems Console X <terminated> Grade (1) [Java Application]](http://img.homeworklib.com/questions/7684cf60-c1be-11ea-a629-afaf4264a2a0.png?x-oss-process=image/resize,w_560)
Java Question Method and 1 dimension arrays (20) YouTube ㄨ Electronics, Cars, Fashion, Co × Upload...
Java Program 1. Write a class that reads in a group of test scores (positive integers from 1 to 100) from the keyboard. The main method of the class calls a few other methods to calculate the average of all the scores as well as the highest and lowest score. The number of scores is undetermined but there will be no more than 50. A negative value is used to end the input loop. import java.util.Scanner; public class GradeStat {...
Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes numeric scores for a class. The program prompts the users to enter the class size (number of students) to create a single-dimensional array of that size to store the scores. The program prompts the user to enter a valid integer score (between 0 and 100) for each student. The program validates entered scores, rejects invalid scores, and stores only valid scores in the array. The program...
In Java Main method Your main program will prompt the user for a test name and the number of scores the user will enter. After creating an arraylist to hold the scores, prompt the user for all the scores to hold in the arraylist. After all the scores are entered, then repeat back the score & letter grade. GradeBook Object Create an instance of a GradeBook object and pass the test name and arraylist to set the instance variables. At...
Create a program named IntegerFacts whose Main() method declares an array of 10 integers. Call a method named FillArray to interactively fill the array with any number of values up to 10 or until a sentinel value (999) is entered. If an entry is not an integer, reprompt the user. Call a second method named Statistics that accepts out parameters for the highest value in the array, lowest value in the array, sum of the values in the array, and...
Hey, need some help in Java. I'm stuck on one step that prevents me from doing the rest of the steps and need help on it. I also have a problem when I print databaseCourse and programmingCourse. instead of saying 5 and 7 respectively is shows 51 and 71. Step 8: in CourseGrades, create a method, add, that takes two parameters, studentNum and grade, and changes the grade of student studetNum to the given grade, grade. studentNum represents the student...
[JAVA/chapter 7] Assignment: Write a program to process scores for a set of students. Arrays and methods must be used for this program. Process: •Read the number of students in a class. Make sure that the user enters 1 or more students. •Create an array with the number of students entered by the user. •Then, read the name and the test score for each student. •Calculate the best or highest score. •Then, Calculate letter grades based on the following criteria:...
in
java
Part 1 In this section, we relook at the main method by examining passing array as parameters. Often we include options/flags when running programs. On command line, for example, we may do “java MyProgram -a -v". Depending on options, the program may do things differently. For example, "a" may do all things while "-v" display messages verbosely. You can provide options in Eclipse instead of command line: "Run ... Run Configurations ... Arguments". Create a Java class (Main.java)....
Implement a Java program using simple console input & output and logical control structures such that the program prompts the user to enter 5 integer scores between 0 to 100 as inputs and does the following tasks For each input score, the program determines whether the corresponding score maps to a pass or a fail. If the input score is greater than or equal to 60, then it should print “Pass”, otherwise, it should print “Fail”. After the 5 integer...
Programming 5_1: Create a Java class named <YourName>5_1 In this class create a main method, but for now leave it empty. Then write a Java method getAverage which takes an array of integers as it’s argument. The method calculate the average of all the elements in the array, and returns that average. The method should work for an array of integers of any length greater than or equal to one. The method signature is shown below: public static double getAverage(...
pls help java ASAP!!!!!!!
Topic String Tokenizer Static Methods Static Variables Primitive Arrays Description Enhance the last assignment by providing the following additional features: (The additional features are listed in bold below) Class Statistics In the class Statistics, create the following static methods (in addition to the instance methods already provided). • A public static method for computing sorted data. • A public static method for computing min value. • A public static method for computing max value. • A...