
Hello. Can someone please help me with writig the following programm. Assignment 20% Presentation 10% Mini Test 10% Exam 60%
Java program that accepts the following details: student ID number, full name and marks for the 4 assessments above as input. It should then determine and output the final mark and grade for each student. The grade awarded is based on the following scheme:
Final mark Grade Less than 40 Fail Less than 60 Pass Less than 70 Credit More than or equal to 70 Distinction The students ID number should contain 2 numbers and 2 letters. E.g. 33GG
The application should display the details of the student and final mark and grade. to provide a menu of options to the user including adding a student and terminating the application.
Regards!

Hi Friend,
Try the following code:
import java.util.*;
public class StudentResult{
String studentID;
String name;
double assignment;
double presentation;
double test;
double exam;
double total;
String grade;
public void setStudentID(String studentID){
this.studentID=studentID;
}
public String getStudentID(){
return studentID;
}
public void setName(String name){
this.name=name;
}
public String getName(){
return name;
}
public void setAssignment(double assignment){
this.assignment=assignment;
}
public double getAssignment(){
return assignment;
}
public void setPresentation(double presentation){
this.presentation=presentation;
}
public double getPresentation(){
return presentation;
}
public void setTest(double test){
this.test=test;
}
public double getTest(){
return test;
}
public void setExam(double exam){
this.exam=exam;
}
public double getExam(){
return exam;
}
public void setTotal(double total){
this.total=total;
}
public double getTotal(){
return total;
}
public void setGrade(String grade){
this.grade=grade;
}
public String getGrade(){
return grade;
}
public static void main(String[]args){
Scanner input=new Scanner(System.in);
int menu = 0;
System.out.println("Student Result");
System.out.println();
System.out.println("1. Add a student");
System.out.println("2. Exit");
boolean quit = false;
do{
System.out.print("Please enter your choice: ");
menu = input.nextInt();
System.out.println();
switch(menu) {
case 1:
StudentResult data[]=new StudentResult[2];
for (int i=0; i<data.length; i++) {
int j=i+1;
System.out.println("********Student "+j+"*********");
System.out.println("Enter Matric No");
String no=input.next();
System.out.println("Enter Name: ");
String n=input.next();
System.out.println("Enter Assignment marks");
double m1=input.nextDouble();
System.out.println("Enter Presentation marks");
double m2=input.nextDouble();
System.out.println("Enter Test marks");
double m3=input.nextDouble();
System.out.println("Enter Exam marks");
double m4=input.nextDouble();
double tm=.20*m1+.10*m2+.10*m3+.60*m4;
System.out.println("Total Marks="+tm);
data[i] = new StudentResult();
data[i].setStudentID(no);
data[i].setName(n);
data[i].setAssignment(m1);
data[i].setPresentation(m2);
data[i].setTest(m3);
data[i].setExam(m4);
data[i].setTotal(tm);
if(tm<40){
data[i].setGrade("Fail");
}
if(tm>40&&tm<60){
data[i].setGrade("D");
}
if(tm>60&&tm<70){
data[i].setGrade("C");
}
if(tm>70&&tm<90){
data[i].setGrade("B");
}
if(tm>90){
data[i].setGrade("A");
}
}
for(int i=0;i<2;i++){
StudentResult show = data[i];
String ide=show.getStudentID();
String nn=show.getName();
double as=show.getAssignment();
double pr=show.getPresentation();
double tt=show.getTest();
double ee=show.getExam();
double tot=show.getTotal();
String g = show.getGrade();
System.out.println(ide + " " + nn + " " + as+" "+pr+" "+tt+" "+ee+" "+tot+" "+g);
}
break;
case 2:
quit = true;
break;
default:
System.out.println("Invalid Entry!");
}
}
while (!quit);
}
}
Thanks