File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hello...I need only help....in this question

 
Ahmed Mohamed
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to implement a class that will read marks of every student in different subjects and determine his grade. Grades are based on the average marks.

Given below are the criteria for deciding grades:

Average mark Below 40 Grade = �F�
Between 40 to 54 Grade = �D�
Between 55 to 69 Grade = �C�
Between 70 to 84 Grade = �B�
Above 85 Grade = �A�

Write a well-designed class having default and parameterized constructors to instantiate the class.
Also write different functions to:
1)take user inputs for student name, id and marks for various subjects,
2)get the total number of students entered,
3)number of students falling under every grade, and
4)Generate an annual report for a student in five subjects: Mathematics, Computers, Science, Arts and Games.

* Use Vectors to store every student record


i need only help about the idea of this question......ok..so far i understand that ... here is an outline of my idea :

public class Student
{
string name;
int mark;
int id;

void getInfo()
{}

void getTotalNumber()
{}

}

then i have to start the main function

public static void main (string[] args)
{

// i have to create objects to access the functions
}


please..is this design i correct so far?
i have some doubts about the fucntions point(3) and (4)
also...im confused about the the step of asking the user to input someting.... where do i have to use JOptionpane....inside the main fuction or outside?

thank you very much for help.
 
Jeff Bosch
Ranch Hand
Posts: 805
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've seen this problem before! College, first-year Java programming?

You need to move the main method inside your class declaration, or build another driver program (class) that includes the main method. For this type of problem, you may want to use the second way, a separate driver program.

The JOptionPane interaction with the user goes inside the main method.

Good luck! You're off to a good start.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better use "String" not "string",
 
Jeff Bosch
Ranch Hand
Posts: 805
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good point. Thanks, Barry.
 
Nigel Browne
Ranch Hand
Pie
Posts: 682
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to break down the requirements and decide what classes are needed. Next look at the attributes each class should possess and what behaviour they should perform. You have made a good start, but don't forget that each student must be aware of the courses it is taking.
If your using JDK 1.5 you might consider using the new enum mechanism to manage to list of courses.

Have fun doing this project and post whenever you get stuck.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic