Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

complete this use java The main method shown below should compute the average final grade for a course. The array midterm contains the midterm grade

complete this use java
The main method shown below should compute the average final grade for a course.
The array midterm contains the midterm grade (out of 100) for the students in the course. There are never missing midterm grades.
The array exam contains the midterm grade (out of 100) for the students in the course. A value of -1 indicates that the exam was not written.
midterm[i] and exam[i] are the grades for the same student.
The final grade for a student is computed using the following rules:
if the exam grade is missing then the final grade is -1 (incomplete)
if the exam grade is not missing then the final grade is computed as 25% of the midterm grade plus 75% of the exam grade rounded to the nearest integer value (use Math.round to perform the rounding)
Finally, the average grade for the course is computed as the average grade over all of the students who completed the course (students with an incomplete final grade are not included in the calculation of the average).
Complete the main method so that it:
computes the array grade containing the final grade for each student in the course
computes the value avg equal to the average grade as described above
You should assume that whoever is marking your work will change the arrays midterm and exam, however, you may assume that at least one student completes the course and that the arrays both have the same size.
You can submit your work by filling in the textbox below, or by uploading your .java file containing the main method.
You do not need to use methods in your solution (but you may) and you do not need to include any comments.
You may use Arrays.toString to print an array, but you must not use any other classes in your solution.
image text in transcribed
image text in transcribed
import java.util.Arrays; public class Grade { public static void main(String[] args) { public static void main(String[] args) { int Il midterm 190, 85, 55, 60, 10, 79); 7T intl exam {90, 80, -1, 70, 35, 65)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions

Question

3. Where is the job to be accomplished?

Answered: 1 week ago

Question

Example. Evaluate 5n+7 lim 7-00 3n-5

Answered: 1 week ago