1

Hey guys I need to hand in this assingment and actually made an account for this as I know this is one of the best forums so far that I have came across about programing, so it would be awesome if someone could help me out with this.

So first off my assingment task is:
Task 4
Implement a piece of software that records the marks (coursework and exam) for all
students taking a particular module at UEL. You must invent a name for the module and
this name should be displayed on screen.The software should allow students to be
added and removed to the list and for their marks to be recorded. The system should be
able to produce a final report card for each student indicating the marks recorded and the
overall module decision (pass, fail, retake coursework and so on).

And so far i've done this:

import javax.swing.JOptionPane;


class Student 
{
final double ASSIGNMENT_ONE_PERCENTAGE = .50;
final double FINALEXAM_PERCENTAGE = .50;

String name, finalLetterGrade;
int assignmentOne = 0;

int finalExamGrade = 0;
double finalNumericGrade = 0;


public Student() {
System.out.println ("Module JK1337 Computer Processing ...");

}

public void inputGrades() {
name=JOptionPane.showInputDialog("Enter Student's full Name:");
assignmentOne = Integer.parseInt(JOptionPane.showInputDialog( "Enter the Assignment Marks" ));
finalExamGrade = Integer.parseInt(JOptionPane.showInputDialog( "Enter the Final Examination Marks" ));

}

public double getAverage(){
finalNumericGrade =
(assignmentOne * ASSIGNMENT_ONE_PERCENTAGE) +
(finalExamGrade * FINALEXAM_PERCENTAGE);
return finalNumericGrade;
}


private String letterGrade(){
if (finalNumericGrade >= 70)
finalLetterGrade = "Destinction";
else
if ((finalNumericGrade >= 55) & (finalNumericGrade < 70))
finalLetterGrade = "Merit";
else
if ((finalNumericGrade >= 40) & (finalNumericGrade < 55))
finalLetterGrade = "Pass";
else
if (finalNumericGrade < 39)
finalLetterGrade = "Fail";

return finalLetterGrade;


}


public String toString() {
String studentStringValue= " Student Name is: "+name +"\n";
studentStringValue+= " Assignment One grade is: " + assignmentOne + "\n";
studentStringValue+=" Final Exam is: " + finalExamGrade + "\n";
studentStringValue+=" Final Numeric Grade is: " + finalNumericGrade + "\n";
studentStringValue+=" Final Letter Grade is: " + finalLetterGrade +"\n";

return studentStringValue;
}


public void printName(){
System.out.print(" "+name);
}
    public static void main(String[] args)
    {
    Student s = new Student();
    s.inputGrades();
    System.out.println("Average --> " + s.getAverage());
    System.out.println("Letter grade --> " + s.letterGrade());
    System.out.println("Student name() --> " + s.toString());

    }
}

So what I need help is in same way to seperate the assingment marks and exam marks so it shows for example if I get 40 marks on assingment and 30 on exam, then it should say that the user needs to retake exam. Another thing is I need to allow the program to input students and delete them, after these 2 main problems i'll just need to make some sort of 2nd class to meet the minimum criteria such as a tester class.
Hope you guys could help thanks.
By the way its due on thursday so i'll require help as soon as possible

Edited by Ezzaral: code formatting

5
Contributors
61
Replies
62
Views
5 Years
Discussion Span
Last Post by Ezzaral
0

Do you have any specific java coding questions? Your questions seem to be looking for someone to write code for you instead of asking how to do something in java.

1

No I am very much a newb to programming and if you can give me the codes for the functions I require that would be awesome, I need help in some way to seperate the assingment marks and exam marks so it shows for example if I get 40 marks (which is minimum to pass) on assingment and 30 on exam, then it should say that the user needs to retake exam only.
Another thing is I need to allow the program to input students and delete them, after these 2 main problems i'll just need some sort of 2nd class to meet the minimum criteria such as a tester class if you could help me make that as well would be awesome.
Hope you could help thanks.

1

So the things I need the program to do which isn't at the moment are:

1) Add and delete the Students
2) Should tell me if I will need to retake assingment or exam or both minimum pass marks being 40 so for example if I get 40 marks (which is minimum to pass) on assingment and 30 on exam then it should say that the student needs to retake exam only. etc
3) Then to make a 2nd class such as a tester

0

You will need a way for the user to enter his option: add/remove
For add you need to get the info to build a Student record.
For remove you need an id for the Student record to remove
The Student records need to be stored in a list that can be searched

-1

Ok, if its possible for you to make that code for me to input inside my software would be greats since I have no idea how I can do it.

Votes + Comments
doh
0

Sorry, it's up to you to write the code for your program. If you are interested in learning how to program, that will be the best way for you to learn.
If you are having problems with your code, post it and show the problems and ask some questions.

-1

Or you can give me the necessary codes I need and explain them to me and thus i'll learn them in the process =P

Votes + Comments
Or not. This isn't a homework completion service.
0

Try doing the requirements one at a time.
1) add a student.
What do you need for information to add a student? Where will you get it? Where will you save that info so you can use it later?

1

To store the name, Assingment marks, and Exam marks. After those are entered I want to be able to add another Student

1

The program does work but just like I said closes after one set of record is added

0

Further your knowledge, research this term: data structure

Learn the principles and apply them; this is very basic programming knowledge. Make sure you don't get lost in the more advanced topics, though. Stick with the simpler techniques for now.

0

closes after one set of record is added

Make a loop that continues executing until the user enters some code telling the program to exit the loop.

0

I do not have much time to research. I know its kind of bad asking for the codes straight up but I am running out of time. hope you understand

Votes + Comments
if you know it is wring, don't do it - have some self-respect man
0

Perhaps you should hire a programmer to do your work. I'm not here to help students cheat.

-1

Sorry but more than half of the posts i've been looking at had people sharring there codes helping them out

Votes + Comments
doesn't make it right though, does it?
-1

And so I thought my problem would be a piece of cake for an expert or intermediate level java programmer and thus just taking them few minutes to do

Votes + Comments
lazy
0

syed,
Helping is one thing. Asking others to just give you the code is something else entirely. You don't seem to be putting any effort into this. Even the original piece of code you posted was copied from elsewhere.

Students are expected to make an effort if they wish to receive help here. Norm's already given you some advice on how to proceed. If you won't bother to try to follow it, then you're probably just out of luck.

Edited by Ezzaral: .

Votes + Comments
absolutely correct, of course :)
0

That is probably true. I'm here to help people learn to program, not to do their homework.
You learn more by actively trying to write code. Copy and paste does not teach programming. Obviously you are not interested in learning.

1

How should I create the loop, if you could help me create it then I will much appreciate it

Edited by syed30: smd

1

Which would be best to allow the program to keep on adding different student records untill I hit the Cancel button

1

Could I implement something like this in a new class, some how use it with my user interface input system?

import java.util.Scanner;
public class Main extends Student

{
public static void main(String[]args)
{

Student firstBlock = new Student();
Scanner sc = new Scanner(System.in);
int selection;

do{
System.out.println("\tMenu");
System.out.println("1.Add Students");
System.out.println("2.Add Grades");
System.out.println("3.Remove Students");
System.out.println("4.Remove Grades");
System.out.println("5.Exit");
selection = sc.nextInt();
if(selection == 1){
}
if(selection == 2){
}
}while(selection != 5);
}
}

Edited by Ezzaral: Code formatting. Use it.

0

The code you have posted looks like a standalone program. When executed it will prompt the user for input and use that input to select some code to execute with a series of if statements. You need to add some code in each of the if statements to do some ueeful work.

What happens when you compile and execute the code?

1

It ignores this class so nothing happens, if this isn't right or wouldn't work then what do you suggest

0

The Main class you posted looks ike it should compile and execute.
Does it compile without errors?
What happens when you execute it?
What is the commandline used when the class is executed?
Is it this:
java Main

1

Says "cannot find symbol class Student", when I compile it by itself.

import java.util.Scanner;

public class Main

{
public static void main(String[]args)
{

Student firstBlock = new Student();
Scanner sc = new Scanner(System.in);
int selection;

do{
System.out.println("\tMenu");
System.out.println("1.Add Students");
System.out.println("2.Add Grades");
System.out.println("3.Remove Students");
System.out.println("4.Remove Grades");
System.out.println("5.Exit");
selection = sc.nextInt();
if(selection == 1){
}
if(selection == 2){
}
}while(selection != 5);
}
}

Edited by Ezzaral: Code formatting.

1

This is what happened after I took out "extend Student", but had both classes

Attachments Example_Java.png 24.93 KB