Re: i need help writing a program using array. ASAP!
okY so i got the errors down to 5.. here the new code so far... i forgot to give a option for the user to enter grade..
import java.util.Scanner;
public class Q7_A_112532 {
public static void main(System[] args){
Scanner input = new Scanner(System.in);
int num = 0;
int excellentstudent;
excellentstudent = 0;
double percentage = 0;
int grade;
System.out.print("enter the total number of students: ");
num = input.nextInt();
int i;
int studentarray;
studentarray = new.int[num];
{for (i = 0; i < studentarray.length, i++ )};
sum = sum + arr[num];
System.out.print("Enter the grade of the student: ");
grade = input.nextInt();
if (grade >= 90 )
gradecount ++;
percentage = count * 100 / num;
System.out.printf("The percentage f excellent student is : %.1f", + percentage);
Re: i need help writing a program using array. ASAP!
i am so sorry for bothering you..
Don't worry, I'm just concerned we don't have enough time.
The first two errors I have already explained in an earlier post.
The 3rd error is because the for statement shouldn't be wrapped in curly braces
The 4th is because you probably don't have the same number of opening and closing curly braces hence my earlier comment about formatting your code properly.
Last edited by keang; December 18th, 2012 at 02:32 PM.
Re: i need help writing a program using array. ASAP!
i think the atempt of fixing the last four errors i have messed it all up all over...i bet u might be thinking i am like a crazy person or something.... but i think its slowly getting over m,y head.... now i think i am screwed it big time... coz in the middle i was working on another program... which was fine... but now donno what to do!
Re: i need help writing a program using array. ASAP!
Without seeing the current code it's hard to say exactly but you certainly shouldn't have a '.' in 'new.int' and you probably haven't declared studentarray
Bookmarks