Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help finishing this program in java. I will post what I have of the source

ID: 3675734 • Letter: N

Question

Need help finishing this program in java. I will post what I have of the source code below the question.

Need help with this Java problem,

(Example Problem)

Each exam is worth a maximum of 30 points.

Use a Scanner instance variable (sc) to read input from the keyboard.

Collect the following student information:

First Name (String Type)

Last Name (String Type)

Concatenate these two variable separated by a space to store “First Last” in the array.

3 Exam scores (Integers). Use nextInt() to read in scores.

Validate the incoming integers. Exam scores must be >= 0 and <= 30. Student names must have a length of at least 3 characters.

Use a While loop to collect multiple students' exam data. End the loop with the entry of “N” in response to the Prompt “More student data?”

Use a nested For loop to collect 3 exams for each student.

Store student names in a one-dimensional String array named (students) sized to store 30 names.

Store exam scores (3 per student) in a two-dimensional int array named (studentScores) of integers sized to store up to 30 sets of scores.

Treat these two arrays as parallel arrays. Row 0 in one relates to row 0 in the other, row 1 to row 1 etc.

AFTER data entry into the arrays is completed,

compute the mean score and derive the letter grade for each student and in the aggregate for all students. This means looping through the tables to produce the statistics and the following report. Avoid rounding errors that might occur when computing the aggregate mean.

What I have so far.

import java.lang.String;
import java.util.Scanner;

public class Lab2
{

   public static void main(String[] args) {

       System.out.println("Lab2 Starting");
      
       double totalPoints = 0.0;
       int totalScores = 0;
      
       double mean = 0.0;
      
       String firstName = "";
       String lastName = "";
       String strMore = "y";
      
       final int POINTS_POSSIBLE = 30;
  
       Scanner sc = new Scanner(System.in);
       //Loop to collect student grades.
  
       do
       {
           System.out.print("Enter First Name: ");
           firstName += sc.next();
           System.out.print("Enter Last Name: ");
           firstName += " " + sc.next();
          
           //Collect 3 grades, don't accept a value
           //outside the range of 0 to 30
           for (int i = 0; i < 5; i++)
           {
               double newPoints = 0.0;
               do
               {
                   System.out.print("Please enter grade " + (i+1) + " between 0 and 30 : ");
                   newPoints = sc.nextDouble();
               } while (newPoints < 0d || newPoints > 30d);
              
               totalPoints += newPoints;
               totalScores++;
           }

Please Help!

Explanation / Answer

Here it is. Please let me know if I missed anything :)

package com.dq.thematrix.main.java.test;

import java.lang.String;
import java.util.Scanner;
class mm
{

public static void main(String[] args) {
System.out.println("Lab2 Starting");
  
double totalPoints = 0.0;
double totalScores = 0;
  
double mean = 0.0;
  
String firstName = "";
String lastName = "";
String strMore = "y";
String ch="Y";
double Score;
int countOfStudents=0;
double childScore=0.0;
String nameArr[]=new String[30];
double score[][]=new double[30][3];
  
final int POINTS_POSSIBLE = 30;
  
Scanner sc = new Scanner(System.in);
//Loop to collect student grades.
  
do
{
System.out.print("Enter First Name: ");
firstName += sc.next();
System.out.print("Enter Last Name: ");
lastName += " " + sc.next();
String fullName=firstName+" "+lastName;
nameArr[countOfStudents]=fullName; //storing students name
  
//Collect 3 grades, don't accept a value
//outside the range of 0 to 30
for (int i = 0; i < 3; i++)
{
double newPoints = 0.0;
do
{
System.out.print("Please enter score " + (i+1) + " between 0 and 30 : ");
Score = sc.nextDouble();
} while (Score < 0d || Score > 30d);
score[countOfStudents][i]=Score; //storing students score
totalScores=totalScores+Score;
childScore=childScore+Score;
  
}
System.out.println("Average score of "+fullName+ "is ");
double avg=childScore/3;
System.out.println(avg);
   System.out.println("Do you want to quit? Enter 'N' to quit else type anything");
   ch=sc.next();
   countOfStudents++;
}while(ch!="N");
  
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote