It's not a secret anymore!
The moose likes Beginning Java and the fly likes Re: Urgent with this program, Pls help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Re: Urgent with this program, Pls help" Watch "Re: Urgent with this program, Pls help" New topic

Re: Urgent with this program, Pls help

Jeannie Kaw

Joined: Apr 30, 2002
Posts: 5
Hi, I'm a idiot beginner in Java who have limited knowledge in this lang. Even so, I have 1 program which i not able to complete here. Here is the program aspects which i need to fulfill
Develop this program in Application which will perform the following functions:
Create a record contains 15 students and read the input from user.
1) We are free invited to enter the details of a Student with the name,
and enter the 3 Marks obtained in each 3 subjects.(like..Integer.parseInt(input);read their input
2) Calculate the average test score of each student.
3) Display the name of the student and test score according to their grade esTination, Credit, Pass
or Failed.
Fail=less than 40
Pass=less than 60 more than 40
Credit=Less than 70 more than 60
Destination=More than 70
4) Calculate and display the highest and lowest average score.
5) Develop in Application and print out the input from what user entered.
The report program should display in this format.
Roger Investigation Company
S.No Name of Student Marks in 3 subject Average Grade
Mark1 Mark2 Mark3
1. Mayer 65 79 24 56 PASS
2. Raite 55 78 69 67.33 CREDIT
4. .....................................
till 15 students.
Highest Average = 67
Lowest Average = 56
Below is the source code which i completed, however it shd said incomplete.

My problem is that how i going to create array within array, I'm not able to figure at here. And i got errors when i javac...etc :
int[] incompatiable types.
Could someone show me how to work this program out. I'd appreciate your patience in solving this program.
[ May 02, 2002: Message edited by: Dirk Schreckmann ]
frank davis
Ranch Hand

Joined: Feb 12, 2001
Posts: 1479
int [][] marks = new int[15][3]
creates a multi-dimensional arrray called marks that holds 3 marks for 15 students.
mark[0][0] , mark [0][1], mark[0][2] would hold the first 3 marks for the first student, etc.
You could add another element to hold the average : int [][] marks = new int[15][4]

There's many solutions to this problem, some better. But your instructor should point those out.
[ April 30, 2002: Message edited by: herb slocomb ]
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Jeannie,
I would start the project out using a Student class that handles the important stuff. For example:

Then you could have your GoodLuck class look much cleaner. Something like:

Good Luck,
Jeannie Kaw

Joined: Apr 30, 2002
Posts: 5
Okie, thks everybody. Again, I need u guys help.
1)So right now, I've paste the program elsewhere. Can u tell me how to println the user input, which meant once user input 1 student record:the name n 3 subjects marks, then the program will compute the result and print out with the heading.without going via to enter 4 students records then can be performed.
2) This program can compute/println 4 students records only, can i increase the array up to contains 15 students records?
How shd i modify the program?
3) Can i chose a option like say, the program will println only, when the user enter the command key. For instance:
insert=new student record
I want to know is my program able to add on this option. How am i going to go abt?
Below is my source code, can someone amend on the code itself? Thks alot for your assistance.

[ May 02, 2002: Message edited by: Dirk Schreckmann ]
I agree. Here's the link:
subject: Re: Urgent with this program, Pls help
It's not a secret anymore!