subject

Write a program named Exercise1.java, then implement the following methods: public static int[] gradeStats(String gradebook) throws Exception (don't worry about the exception, you are not required to handle exception).
This method reads all grades in the gradebook and returns highest, lowest and average grade as an int array. The first element represents the highest grade, the 2nd is for lowest, and 3rd one is for average.
public static int multiplesOf7(int N, int M), this method counts and returns how many multiples of 7 are between [N, M], assume N<=M
For example, calling multiplesOf7(10, 23) should return 2, because there are two numbers 14 and 21 are multiples of 7 in the range [10, 23].
public static boolean isValidTriangle(int a, int b, int c), this method determines if the three numbers, a, b, c can form a triangle (a, b,c are 3-side not angles), if yes, returns true, otherwise, returns false.
public static int binaryToInt(String binaryString), it takes a word String representing a biniary number (0s and 1s) as parameter and converts it to its decimal representation. For example, calling binaryToInt("0110") should return 6. You can assume that the binaryString is guaranted to contain only 0s and 1s.
public static int[] countWordsInEachLine(String fileName) throws Exception, the first line in the file contains the number of lines of the file, it then reads and counts the number of words in each of the rest lines in the file, and returns those numbers as an int array. The first element in the returned array represents the number of words in the first line, the second element for the second line, and so on.
For example, if the data file: data. txt, contains the following information:
2
line one
line two
calling countWordsInEachLine("data. txt") should return {2, 2}
Note: You may use main method to test your implementations of these methods. However, you MUST run Grader. class to grade your response.
gb1.txt
95 100
90 90 89 90
data. txt
5
Edit contents here
line 2 with some information
line 4
line 5 5 5 5 5 5 5
gb2.txt
5
78 90 89
87
gradebook. txt
10
100
90 89
45 91 98

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 15:00, billlyyyyyyyyyy
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, evanwall91
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
image
Computers and Technology, 23.06.2019 20:00, boo3972
Match the file formats with the types of multimedia they can store
Answers: 2
image
Computers and Technology, 23.06.2019 20:30, lucywood2024
What is the biggest difference between section breaks and regular page breaks
Answers: 1
You know the right answer?
Write a program named Exercise1.java, then implement the following methods: public static int[] gra...

Questions in other subjects: