>Define rational number as an ADT (abstract data structure)
I fail to see how this is difficult. What kept you from completing the exercise?

>Write a suitable C code to sort a finite set of elements
>where an element may appear a large number of times
Well any general sorting algorithm will do this, so now you only need to find one where the processing of duplicate values is efficient. Might I suggest counting sort?

Actually, I just couldn't understand the question.
All I know about rational numbers is that they are Set of Real Numbers minus Set of Irrational Numbers Or another way of defining them is "Any number that can be expressed in p/q format where q≠0 (p & q belong to set of integers)"
But I don't know how to express them as an ADT

>Any number that can be expressed in p/q format where q≠0 (p & q belong to set of integers)
Translation: rational numbers can always be represented by a fraction p/q where q is not zero. So you need to write a common fraction "class":

typedef struct rational {
int numerator;
int denominator;
} rational;

import java.util.Scanner;
public class LuckySevens {
private int diceLength;
private int rolls;
private int sides;
private int numRolls = 0;
public static void main (String [] args) {
Scanner reader ...

I am working creating a fully encapsulated, homogeneous singly linked data structure. The Listing class and SinglyLinkedList class that are part of the whole application compile fine, but the problem ...