Jump to content

One challenge for the structure

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
DimaStudMaestro1

DimaStudMaestro1

    Newbie

  • Members
  • Pip
  • 2 posts
Help please in the problem, in the condition:
Write a program for building information about student performance. Each entry must contain a statement that the group number, name of student, grade point average for the last session. Display the list of students in groups. In each group the names of students placed in descending order of average scores.
Display the list, I still know how to do but how to make that the names were in descending order, do not know!

#2
bobdark

bobdark

    Programmer

  • Members
  • PipPipPipPip
  • 164 posts
Use some data structure to store the entries. Store in the data structure a comparison function (that defines bigger than relation). Implement a function that sorts the list (search Google for some sorting algorithm) or insert each entry in the right place and keep the data structure sorted. Then use a function that iterates on all the nodes in the data structure and prints each node.

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
If I were doing it, I would probably use a SQLite database to store the data. However, if you're doing this for an assignment, I would start by making a vector of "student" classes.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog