GATE Exam  >  GATE Questions  >  Consider a program which stores the frequency... Start Learning for Free
Consider a program which stores the frequency of marks of student in a particular subject say Mathematics. The marks is in the range [0...100] and there are around 500 students. But there is one condition we only want to record frequency if the student has passed in the exam, the passing marks being 40. What is the best way to store the frequency of marks above 40?
  • a)
    An array of 500 numbers
  • b)
    An array of 100 numbers
  • c)
    An array of 40 numbers
  • d)
    An array of 60 numbers
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Consider a program which stores the frequency of marks of student in a...
For this purpose, we can ignore the below forty numbers and have an array of 60 index to store the individual frequencies from 40 to 100.
View all questions of this test
Most Upvoted Answer
Consider a program which stores the frequency of marks of student in a...
Explanation:

The best way to store the frequency of marks above 40 for 500 students is to use an array of 60 numbers. Here's why:

1. Range of marks: The marks range from 0 to 100, but we only want to record the frequency of marks above 40. So, we need an array that can hold values in the range [41...100].

2. Number of students: There are 500 students, so we need an array that has 500 elements.

3. Frequency of marks above 40: We only want to store the frequency of marks above 40, so we don't need to store the frequency of marks between 0 and 40.

4. Number of elements in the array: To store the frequency of marks above 40 for 500 students, we need an array that has 60 elements. The reason is that there are 60 possible values of marks above 40, which are [41, 42, 43, ..., 99, 100]. So, each element of the array corresponds to one possible value of marks above 40.

5. Example: Suppose we have the following data for 5 students:

- Student 1: 35 (failed)
- Student 2: 45 (passed)
- Student 3: 80 (passed)
- Student 4: 60 (passed)
- Student 5: 95 (passed)

We only need to record the frequency of marks above 40, so we don't care about the marks of Student 1. For the other 4 students, we need to increment the frequency of the corresponding element in the array. Here's how the array would look like after processing the above data:

- [ 0, 1, 0, 0, ..., 0, 1, 1, 1, ..., 1, 1 ] (an array of 60 numbers)

The first element represents the frequency of marks 41, the second element represents the frequency of marks 42, and so on, until the last element represents the frequency of marks 100.
Explore Courses for GATE exam

Similar GATE Doubts

Consider a program which stores the frequency of marks of student in a particular subject say Mathematics. The marks is in the range [0...100] and there are around 500 students. But there is one condition we only want to record frequency if the student has passed in the exam, the passing marks being 40. What is the best way to store the frequency of marks above 40?a)An array of 500 numbersb)An array of 100 numbersc)An array of 40 numbersd)An array of 60 numbersCorrect answer is option 'D'. Can you explain this answer?
Question Description
Consider a program which stores the frequency of marks of student in a particular subject say Mathematics. The marks is in the range [0...100] and there are around 500 students. But there is one condition we only want to record frequency if the student has passed in the exam, the passing marks being 40. What is the best way to store the frequency of marks above 40?a)An array of 500 numbersb)An array of 100 numbersc)An array of 40 numbersd)An array of 60 numbersCorrect answer is option 'D'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Consider a program which stores the frequency of marks of student in a particular subject say Mathematics. The marks is in the range [0...100] and there are around 500 students. But there is one condition we only want to record frequency if the student has passed in the exam, the passing marks being 40. What is the best way to store the frequency of marks above 40?a)An array of 500 numbersb)An array of 100 numbersc)An array of 40 numbersd)An array of 60 numbersCorrect answer is option 'D'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider a program which stores the frequency of marks of student in a particular subject say Mathematics. The marks is in the range [0...100] and there are around 500 students. But there is one condition we only want to record frequency if the student has passed in the exam, the passing marks being 40. What is the best way to store the frequency of marks above 40?a)An array of 500 numbersb)An array of 100 numbersc)An array of 40 numbersd)An array of 60 numbersCorrect answer is option 'D'. Can you explain this answer?.
Solutions for Consider a program which stores the frequency of marks of student in a particular subject say Mathematics. The marks is in the range [0...100] and there are around 500 students. But there is one condition we only want to record frequency if the student has passed in the exam, the passing marks being 40. What is the best way to store the frequency of marks above 40?a)An array of 500 numbersb)An array of 100 numbersc)An array of 40 numbersd)An array of 60 numbersCorrect answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Consider a program which stores the frequency of marks of student in a particular subject say Mathematics. The marks is in the range [0...100] and there are around 500 students. But there is one condition we only want to record frequency if the student has passed in the exam, the passing marks being 40. What is the best way to store the frequency of marks above 40?a)An array of 500 numbersb)An array of 100 numbersc)An array of 40 numbersd)An array of 60 numbersCorrect answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider a program which stores the frequency of marks of student in a particular subject say Mathematics. The marks is in the range [0...100] and there are around 500 students. But there is one condition we only want to record frequency if the student has passed in the exam, the passing marks being 40. What is the best way to store the frequency of marks above 40?a)An array of 500 numbersb)An array of 100 numbersc)An array of 40 numbersd)An array of 60 numbersCorrect answer is option 'D'. Can you explain this answer?, a detailed solution for Consider a program which stores the frequency of marks of student in a particular subject say Mathematics. The marks is in the range [0...100] and there are around 500 students. But there is one condition we only want to record frequency if the student has passed in the exam, the passing marks being 40. What is the best way to store the frequency of marks above 40?a)An array of 500 numbersb)An array of 100 numbersc)An array of 40 numbersd)An array of 60 numbersCorrect answer is option 'D'. Can you explain this answer? has been provided alongside types of Consider a program which stores the frequency of marks of student in a particular subject say Mathematics. The marks is in the range [0...100] and there are around 500 students. But there is one condition we only want to record frequency if the student has passed in the exam, the passing marks being 40. What is the best way to store the frequency of marks above 40?a)An array of 500 numbersb)An array of 100 numbersc)An array of 40 numbersd)An array of 60 numbersCorrect answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider a program which stores the frequency of marks of student in a particular subject say Mathematics. The marks is in the range [0...100] and there are around 500 students. But there is one condition we only want to record frequency if the student has passed in the exam, the passing marks being 40. What is the best way to store the frequency of marks above 40?a)An array of 500 numbersb)An array of 100 numbersc)An array of 40 numbersd)An array of 60 numbersCorrect answer is option 'D'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev