I know it says u help with hw only if u put some effort,, btu in this case i tried understanding the porogram but i dont kno where to start, this is my first year and first time doing java and this prog is 15 % of the whole module. i need to submit it in 4 days thats the 28 feb 2008 . anyone who can help me out plz mail me at [I]<<snip>>[/I]. thx

Problem Specification

You are required to build a simple application to Read Module details from
a text file (ModulesList.txt) then to import student marks for a given module
from set of text files (mark1,2,3.txt for testing)

Instead of writing a report for the program, documentation will be tested
by using the javadoc tool.
For details about how to write Doc Comments for the Javadoc Tool
check: http://java.sun.com/j2se/javadoc/writingdoccomments/index.html

After Creatig your documentation HTML files using Javadoc Tool compress the files to a zip file
under the name javadoc.zip . this will be marked individualy by your group tutor.
the file must be save under the name javadoc.zip so coursemarker can save it when you submit your work.

Method

The Program has 7 java files:

CsReporter.java

This is the file where the main resides.
First you need to print the program menu, then to get the user Choice and call the correspondent
method to execute the required function.

The menu options are written in the file menu.txt.
You need to create a method to read the text from this file and print it to user.

ModExercise.java

This class represent an exercise within a module.
Each exercise has these attributes:

String name //this is the exercise name
double max // Max Mark for this exercise
double min // Min Mark for this exercise
double total // total of the marks (used to calculate the average later)
HashMap<String, ExerciseMark> marks // a hash map with student marks, the key is the student ID

all these attributes should be defined as private.
You should Have The following Methods in your class:

print() //to print the exercise statistics
printStudentMarks(String id) // to print a specific student marks
readMarks(String fileName) // to import the exercise details from a mark file
the Class constructor should be like:

public ModExercise(String fileName) {
    readMarks(fileName);
}

ExerciseMark.java

This class represent a single student mark.
For this exercise we are using a sample from G51PRG marks.
A student mark is represented in the text file like:
Java:u1:ex1:aag07u:2005.9.11-14.12.7:aag07u: 100:Compilation Tool:100.0:Typographic Tool:100.0:
ALL Dynamic Tests:100.0:Feature Tool:100.0:

The 7th field is the final mark.
For each sub category it have a separate mark, i.e. Compilation Tool:100.0

The ExerciseMark Class should have 2 fields:

    int finalMark;
    HashMap<String,Double> partialMarks //this is to hold each sub category mark

The class should implements Comparable interface.

public class ExerciseMark implements Comparable<ExerciseMark>

Any 2 ExerciseMark objects should be compared according to the finalMark attribute.

A student May have a duplicate submissions, in that case you should remove any older marks
and keep only the most recent one.

You need a method to calculate the average mark for exercise. You need to cast the average to int.

Module.java

This class represents a module, i.e. G51PRG
The class contains the following attributes:

String code // Module code i.e. G51PRG 
String name 
int credits
int level
String semester
String prerequisites
ArrayList<ModExercise> exercises // list of exercises for this module

You need to read the module details from a text file (ModuleList.txt), the format of the file is:
code:name:credits:level:semester:prerequisites
G51PRG:G51PRG Programming:20:1:Full year:None

This Class should have the following methods:

public ArrayList<ModExercise> getAllExMarks()

Which prompt the user to enter the number of files to be imported, the program assumes all file name are in the format:

mark1.txt, ,mark2.txt, ....

 printModuleDetails() 
 printExercisesStatistics()
 printStudentStatistics(String id)// tahes student ID and print his details, see typical input & output

ModuleManager.java

This class should have one Attribute:

HashMap<String, Module> modules = new HashMap<String, Module>();

The key is the module code.

You should create the following methods:

public Module selectModule() throws NoSuchElementException
public void printAllModuleDetails()
public HashMap<String, Module> ReadModulesDetails() // reads modules details from the text file

Util.java

This class is for you to create any methods that you see fit to help you in the program
for example you will be reading text files in various parts of the program, so it can be useful
to have a method that parse files and retun an ArrayList of lines in that file for further processing.

public static ArrayList<String> readFile(String fileName)

methods in Util class nee to be static so it can be used through class name.

Messages.java

You do not need to change this class, this is to introduce a better way to print messages in your program
This class uses messages.properties file.
you should use Messages.getString(key) to get any string to be printed from messages.properties file

System.out.println(Messages.getString("ModExercise.ExerciseReport"));

messages.properties should have an entry:

ModExercise.ExerciseReport=\ Exercise Detail Report

This makes it much easier to have control and change the messages that you print to user.

Notes

You May create any Extra supporting Methods or classes as you see fit
If you need to add any more classes you can use the Util.java file.

Class Attributes should be declared as private and NOT static.
To access any class Attribute you should have set and get method for this Attribute.
i.e.

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}

Any constant value should be declared as public static final.

You can add any extra methods as you see fit for any of the classes, the mentioned methods
is the minimum requirement.

You May find it useful to use For-Each Loop to deal with lists (ArrayLists for example)
check: http://java.sun.com/j2se/1.5.0/docs/guide/language/foreach.html

You have five (5) submissions.

Error conditions

If the user selected a wrong menu option:
    Illegal Menu Option

Error occurred while reading the module data:
    ***INFO*** Error Importing Module Data

Error occurred while reading the any file: 
***INFO*** An Error has occurred while trying to read (file name here)

Mark scheme

Dynamic correctness
Typographic tests
Feature tests and documentation

Typical Input/Output

Computer Science Module Reporter

1: Read Modules Details
2: Read Module Mark Files
3: Select a Module
4: Print All Modules Details
5: Print Module Statistics
6: Print Student Marks
Q: Quit

Enter your choice:1
Please enter file name:ModulesList.java
***INFO*** Error Importing Module Data 

Computer Science Module Reporter

1: Read Modules Details
2: Read Module Mark Files
3: Select a Module
4: Print All Modules Details
5: Print Module Statistics
6: Print Student Marks
Q: Quit

Enter your choice:1
Please enter file name:ModulesList.txt
***INFO*** Module Data Imported Successfully

Computer Science Module Reporter

1: Read Modules Details
2: Read Module Mark Files
3: Select a Module
4: Print All Modules Details
5: Print Module Statistics
6: Print Student Marks
Q: Quit

Enter your choice:2
Please Enter Module Code: G51PRG
Current Selected Module is:G51PRG
Please Enter number of mark files to read:3
***INFO*** Marks Data Imported Successfully

Computer Science Module Reporter

1: Read Modules Details
2: Read Module Mark Files
3: Select a Module
4: Print All Modules Details
5: Print Module Statistics
6: Print Student Marks
Q: Quit

Enter your choice:3
Please Enter Module Code: G51PRG
Current Selected Module is:G51PRG

Computer Science Module Reporter

1: Read Modules Details
2: Read Module Mark Files
3: Select a Module
4: Print All Modules Details
5: Print Module Statistics
6: Print Student Marks
Q: Quit

Enter your choice:4

G51DBS Module Detail Report

Module Name:G51DBS Database Systems
Module Credits:10
Module Semester: Spring
Module Level:1
Module Prerequisites: None

G51PRG Module Detail Report

Module Name: G51PRG Programming
Module Credits: 20
Module Semester: Full year
Module Level: 1
Module Prerequisites: None
For Exercise: ex1 AVG Mark is: 99
For Exercise: travel AVG Mark is: 94
For Exercise: debug AVG Mark is: 92

G52OBJ Module Detail Report

Module Name: G52OBJ Object-oriented Methods
Module Credits: 10
Module Semester: Spring
Module Level: 2
Module Prerequisites: G51PRG

Computer Science Module Reporter

1: Read Modules Details
2: Read Module Mark Files
3: Select a Module
4: Print All Modules Details
5: Print Module Statistics
6: Print Student Marks
Q: Quit

Enter your choice: 5
G51PRG Programming Module Report 

ex1 Exercise Detail Report

MAX Mark: 100
MIN Mark: 80
AVG Mark: 99
Number of submissions: 120

travel Exercise Detail Report

MAX Mark: 100
MIN Mark: 35
AVG Mark: 94
Number of submissions: 117

debug Exercise Detail Report

MAX Mark: 100
MIN Mark: 60
AVG Mark: 92
Number of submissions: 119

Computer Science Module Reporter

1: Read Modules Details
2: Read Module Mark Files
3: Select a Module
4: Print All Modules Details
5: Print Module Statistics
6: Print Student Marks
Q: Quit

Enter your choice:6
Enter Student ID: eoe

G51PRG Programming Module Report 
eoe Marks Report
=============================
Student Mark for ex1 is:100
eoe has no submissions for travel
eoe has no submissions for debug

Computer Science Module Reporter

1: Read Modules Details
2: Read Module Mark Files
3: Select a Module
4: Print All Modules Details
5: Print Module Statistics
6: Print Student Marks
Q: Quit

Enter your choice: q
Thanks for Using CS Module Reporter
jasimp commented: I hope you fail -1

Recommended Answers

All 5 Replies

We are not going to help you cheat. Learn English. Read the rules. Why would we do your work for you? Do you really believe we don't have better things to do?

wow that was unpleasant

Well, reality often is.

Especially given that you said you read the forum rules regarding homework and choose to disregard them and beg someone to do the assignment for you - and you can't even trouble yourself to make an attempt at proper English (That mess you typed is from laziness, not lack of experience with English).

Perhaps it will be a learning experience for you. Good luck.

choose another major, if you can't figure out the logic behind it, while it represents 15% of the points for that module, well.... you're quite <insert naughty word here>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.