This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
master stewards:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
garden masters:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
gardeners:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

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

 
Posts: 8
  • 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.
 
pioneer
Posts: 805
  • 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.
 
pioneer
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better use "String" not "string",
 
Jeff Bosch
pioneer
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good point. Thanks, Barry.
 
pioneer
Posts: 704
  • 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.
 
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!