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

JavaProgramming Instructions Write a Java program according to the problem speci

ID: 3622825 • Letter: J

Question

JavaProgramming


Instructions
Write a Java program according to the problem specifications and constraints specified below. Use [part of] your name in the class(es) developed.


Problem Definition
Determine the letter grade earned by a student from exam, and lab or project points.

Input (keyboard):
A student name, three exam scores, and a lab or project score total. For command line input, include user prompts and echo the inputs.

Output (screen):
Show total points and the resulting letter grade along with identifying labels.

Processing
Sum the points earned on the exams, and labs or projects. Determine a letter grade from the point total. For a point total >= 90% of points possible, assign the letter grade "A"; a point total >= 80% (and < 90%), assign "B"; and for a total less than 60% of points possible, or total lab/project points < 120, assign "F".

Design and Style Constraints
1. Insert a block comment at the top of your class file(s) with your name, the course code, lab number and a brief program description. Also insert one or more line comments.
2. Make meaningful identifier names, apply conventional Java case usage, initialize variables, and have at least one named program constant (e.g. POINTS_POSSIBLE).
3. Create a class with a method (separate from "main") to determine the letter grade. Methods for mutators and accessors are recommended. You may create a separate driver to test the class developed for student grading.
4. For a solution with command line input, incorporate a loop to repeat the entire process for multiple of students.

Explanation / Answer

please rate - thanks

import java.util.*;
public class gradeBookDriver {
public static void main (String[] args) {
Scanner in=new Scanner(System.in);
Student s = new Student();
int n,i;
System.out.print("How many students are there? ");
n=in.nextInt();
for(i=1;i<=n;i++)
   {System.out.println("For student "+i);
    System.out.print("Enter name: ");
    s.setName(in.next());
    System.out.print("Enter exam1 grade: ");
    s.setExam1(in.nextInt());
   System.out.print("Enter exam2 grade: ");
    s.setExam2(in.nextInt());
   System.out.print("Enter exam3 grade: ");
    s.setExam3(in.nextInt());
   System.out.print("Enter lab or project grade: ");
    s.setLab(in.nextInt());
    s.report();
   }        
}
}

-------------------------------------------

class Student {
static int POINTS_POSSIBLE=500;
static int LAB_F=120;

String name;
int exam1;
int exam2;
int exam3;
int lab;
public int getExam1() {
return exam1;
}

public void setExam1( int value) {
exam1= value;
}
public int getExam2() {
return exam2;
}

public void setExam2( int value) {
exam2= value;
}
public int getExam3() {
return exam3;
}

public void setExam3( int value) {
exam3= value;
}
public int getLab() {
return lab;
}

public void setLab( int value) {
lab= value;
}
public String getName() {
return name;
}

public void setName(String n) {
name = n;
}
public void report()
{int tot;
char grade;
double average;
tot=exam1+exam2+exam3+lab;
    average=tot/(double)POINTS_POSSIBLE*100;
    System.out.println("Student Report");
    System.out.println("Name: "+name);
    System.out.println("Points: "+tot);
    if(average<60||lab<LAB_F)
          grade='F';
    else if(average>90)
          grade='A';
    else if(average>80)
          grade='B';
    else if(average>70)
          grade='C';
    else
          grade='F';   
    System.out.println("Grade: "+grade);
}
}

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