Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java please A class has 'n' students and each student appears for exactly 'k' exams. The class teacher has the list of marks scored

in java please image text in transcribed
image text in transcribed
image text in transcribed
A class has 'n' students and each student appears for exactly 'k' exams. The class teacher has the list of marks scored by all the students and needs to identify the student with the nth Rank. Rank is the position in the sorted list of total marks, from high to low. If two students have equal total marks, their original order is maintained while sorting. Given the initial order of the marks and the required rank of the student, output the index of the chosen student by the teacher. For example, given the data for n = 3 student as performance = [[79, 89, 15], [85, 89, 92], [71, 96, 88]] and the required position be rank = 2, the student with index 2 is the answer. The total marks for each student in class are [183, 266, 255] respectively and the student with total score of 255 has a rank of 2. Function Description Function Description Complete the function findTheRank in the editor below. The function must return an integer, the index of the student at the required rank. findTheRank has the following parameter(s): performance[performance[0],...performance[n-1] [k-1]]: a 2D array of integers that denote the performance (marks) of n students in k exams rank: The required rank Constraints 1sns 10 1sks 10 1 s rank sn. Os performance[ijl s 100 (where 0 si<>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions

Question

Explain what is meant by stockholders limited liability.

Answered: 1 week ago

Question

6. Compare and contrast immune neglect and the focusing illusion.

Answered: 1 week ago