‹ Back to the paper
Design a class Sort which enables a word to be arranged in alphabetical order. The details of the…
Design a class Sort which enables a word to be arranged in alphabetical order. The details of the members of the class are given below:
Class name : Sort
Data members/instance variables:
str : stores a word
len : to store the length of the word
Methods/Member functions:
Sort() : default constructor
void readword() : to accept the word
void arrange() : to arrange the word in alphabetical order using any standard sorting technique.
void display() : displays the original word along with the sorted word
Specify the class Sort giving details of the constructor, void readword(), void arrange() and void display(). Define the main() function to create an object and call the functions accordingly to enable the task.
Answer
No answer yet.
From ISC 2020 Specimen Computer Science Paper 1, question 8.