Write a program for the problem: the array of inetegers
indicating the marks of the students is given, U have to
calculate the percentile of the students aaccording to this
rule: the percentile of a student is the %of no of student
having marks less then him. For eg: suppose Student Marks A
12 B 60 C 80 D 71 E 30 F 45 percentile of C = 5/5 *100 =
100 (out of 5 students 5 are having marks less then him)
percentile of B = 3/5*100 = 60% (out of 5, 3 have markses
less then him) percentile of A = 0/5*100 = 0%.
Answer / Varunesh Pandey
Java code for calculating the percentile of students based on their marks would look like this:nn```javanpublic class StudentMarks {n public static void main(String[] args) {n int[] marks = {12, 60, 80, 71, 30, 45};n for (int i = 0; i < marks.length; i++) {n int count = 0;n for (int j = 0; j < marks.length; j++) {n if (marks[i] > marks[j]) {n count++;n }n }n double percentile = ((double)count / (marks.length - 1)) * 100;n System.out.println("Percentile of student with mark " + marks[i] + ": " + percentile + "%");n }n }n}n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Is jprofiler open source?
I am new to jsf rich faces. I am using rich faces datatable rich:datatable. On entering the value, values get filtered in table. Now how can i get the value i selected in backing bean?
What is mime in java?
What is setstring method in java?
What is a flatmap?
How do I open java console?
How do I install jdk?
What is use of jpa?
What are orm tools in java?
What is hql in java?
What is the use of flatmap?
Why are lambda functions called lambda?