-
December 18th, 2012, 01:44 PM
#13
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);
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|