# Need major help with a project! I dont even know where to start with this, if anyone has any input or anything it would help.

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
4 replies [Last post]
tpratt3
Offline
Joined: 2013-12-02

Using an array to Determine Grades: Complete hands-on project. There are 3 versions of this program, calculate the sum, average, largest, and smallest elements of an array. Pick the one that you like best. Add logic inside the for loop to test if the number is between 90 and 100.If the number is in this range, then it should add 1 to the tally of gradeA. You should have another test to see if the number is between 80 and 89 and if it is it should add 1 to the tally of gradeb. You should continue to have tests for 70 to 79 being gradeC: 60-69 being graded; and below 60 as being gradeF. After the for loop is done , you should display a list of how many students had A's, B's, etc. in the output message box.

If the data is:
90, 100, 80, 85, 63, 73, 80, 92, 90

The display should be something like this:

The sum is 753
The average is 83
The largest test score is 100
The lowest test score is 63
The number of students with scores of 90-100 (A) is 4
The number of students with scores of 80-89 (B) is 3
The number of students with scores of 70-79 (C) is 1
The number of students with scores of 60-69 (D) is 1
The number of students with scores below 60 (F) is 0

- Print the counts for each grade in a message box.

Vishwajit
Offline
Joined: 2013-10-11

Hi tpratt3,

I just saw your post in morning.
This is done. See the code below. Let me know if you want more help.

int arr[] = {90, 100, 80, 85, 63, 73, 80, 92, 90};

public void calculateAll(){

for(int i=0; i=90 && arr[i]<=100){
}
else if(arr[i]>=80 && arr[i]<=89){
}
else if(arr[i]>=70 && arr[i]<=79){
}
else if(arr[i]>=60 && arr[i]<=69){
}
else if(arr[i]<60){
}

// Largest from the array
if(largest

creampemutihwajah
Offline
Joined: 2013-12-17

very informative..thank you

tpratt3
Offline
Joined: 2013-12-02

Thankyou so very much! It has been stressing me out for a week an a half now. God bless you!

Vishwajit
Offline
Joined: 2013-10-11