Please select a subject first
Advertisements
Advertisements
Design a class Toggle which toggles a word by converting all upper case alphabets to lower case and vice versa.
Example: The word “mOTivATe” becomes “MotIVatE”
The details of the members of the class are given below:
| Class name | Toggle |
| Data members/instance variables: | |
| str | stores a word |
| newstr | stores the toggled word |
| len | to store the length of the word |
| Methods/Member functions: | |
| Toggle( ) | default constructor |
| void readword( ) | to accept the word |
| void toggle( ) | converts the upper case alphabets to lower case and all lower case alphabets to upper case and stores it in newstr |
| void display( ) | displays the original word along with the toggled word |
Specify the class Toggle giving details of the constructor, void readword( ), void toggle( ) and void display( ). Define the main( ) function to create an object and call the functions accordingly to enable the task.
Concept: undefined >> undefined
How old was Jem when he broke his arm?
Concept: undefined >> undefined
Advertisements
The first chapter focusses on telling stories. This primarily serves to ______.
Concept: undefined >> undefined
What literary significance does Mr Radley’s sealing the knot-hole in the tree have?
Concept: undefined >> undefined
Which one of the following lines from the novel is thematically significant?
Concept: undefined >> undefined
According to legend, who was Bon Bibi’s father?
Concept: undefined >> undefined
Statement 1: There was no bindi on her forehead and her arms were free of bangles.
Statement 2: Kanai was convinced that she was a foreigner.
Concept: undefined >> undefined
Why was Nirmal obsessed with Morichjhapi?
Concept: undefined >> undefined
What was the fate of Lucy Hamilton?
Concept: undefined >> undefined
Why does Nora reveal her secret to Mrs Linde in Henrik Ibsen in A Doll’s House?
Concept: undefined >> undefined
“A wife hasn't a right to save her husband's life?” How does the statement present a conflict between love and law?
Concept: undefined >> undefined
The play ends with ______.
Concept: undefined >> undefined
What does the Tarantella reveal?
Concept: undefined >> undefined
Willy [after a pause]: I suddenly could not drive any more.” What does this confession establish about Willy right in the beginning of the play?
Concept: undefined >> undefined
What does Linda call Happy?
Concept: undefined >> undefined
What is the dramatic effect of Linda’s words, “We’re free” in the Requiem?
Concept: undefined >> undefined
Ben went to ______ looking for their father but ended up in ______.
Concept: undefined >> undefined
Ted Hughes’ Pike expresses the narrator’s deep-rooted feeling of ______.
Concept: undefined >> undefined
Which of the following is not true of Lawrence’s Bavarian Gentians?
Concept: undefined >> undefined
Edward Thomas’ As the team’s head brass talks of the impact of ______.
Concept: undefined >> undefined
