Question

Write a C/C++ program that reads a list of words and prints them in alphabetical order...

Write a C/C++ program that reads a list of words and prints them in alphabetical order with one word per line. If two words have the same beginning sequence, the shorter word should be printed first. If the program is called with an “r” on the command line, the list of words should be printed in reverse alphabetical order. Test your program using the bunch-of-words.txt file

bunch-of-words.txt:

To Sherlock Holmes she is always the woman. I have seldom heard him mention her under any other name. In his eyes she eclipses and predominates the whole of her sex. It was not that he felt any emotion akin to love for Irene Adler. All emotions, and that one particularly, were abhorrent to his cold, precise but admirably balanced mind. He was, I take it, the most perfect reasoning and observing machine that the world has seen, but as a lover he would have placed himself in a false position. He never spoke of the softer passions, save with a gibe and a sneer. They were admirable things for the observer--excellent for drawing the veil from men's motives and actions. But for the trained reasoner to admit such intrusions into his own delicate and finely adjusted temperament was to introduce a distracting factor which might throw a doubt upon all his mental results. Grit in a sensitive instrument, or a crack in one of his own high-power lenses, would not be more disturbing than a strong emotion in a nature such as his. And yet there was but one woman to him, and that woman was the late Irene Adler, of dubious and questionable memory.

I had seen little of Holmes lately. My marriage had drifted us away from each other. My own complete happiness, and the home-centred interests which rise up around the man who first finds himself master of his own establishment, were sufficient to absorb all my attention, while Holmes, who loathed every form of society with his whole Bohemian soul, remained in our lodgings in Baker Street, buried among his old books, and alternating from week to week between cocaine and ambition, the drowsiness of the drug, and the fierce energy of his own keen nature. He was still, as ever, deeply attracted by the study of crime, and occupied his immense faculties and extraordinary powers of observation in following out those clues, and clearing up those mysteries which had been abandoned as hopeless by the official police. From time to time I heard some vague account of his doings: of his summons to Odessa in the case of the Trepoff murder, of his clearing up of the singular tragedy of the Atkinson brothers at Trincomalee, and finally of the mission which he had accomplished so delicately and successfully for the reigning family of Holland. Beyond these signs of his activity, however, which I merely shared with all the readers of the daily press, I knew little of my former friend and companion.

One night--it was on the twentieth of March, 1888--I was returning from a journey to a patient (for I had now returned to civil practice), when my way led me through Baker Street. As I passed the well-remembered door, which must always be associated in my mind with my wooing, and with the dark incidents of the Study in Scarlet, I was seized with a keen desire to see Holmes again, and to know how he was employing his extraordinary powers. His rooms were brilliantly lit, and, even as I looked up, I saw his tall, spare figure pass twice in a dark silhouette against the blind. He was pacing the room swiftly, eagerly, with his head sunk upon his chest and his hands clasped behind him. To me, who knew his every mood and habit, his attitude and manner told their own story. He was at work again. He had risen out of his drug-created dreams and was hot upon the scent of some new problem. I rang the bell and was shown up to the chamber which had formerly been in part my own.

Next day Pierre came to say good-by. Natasha was less animated

than she had been the day before; but that day as he looked at her

Pierre sometimes felt as if he was vanishing and that neither he nor

she existed any longer, that nothing existed but happiness. "Is it

possible? No, it can't be," he told himself at every look, gesture,

and word that filled his soul with joy.

When on saying good-by he took her thin, slender hand, he could

not help holding it a little longer in his own.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program to Convert Deumal to octal fat covert Dermal to octal tant decnolNcm fat de Rinal Nember: de tiral Membr):de lo return octol Number C code for to Ignvert deuna, to hexa decanol int main Char hexade canal NUmb呱00); print f ( 1enter2 ( temp 10) temp- tempa elre tenp temp+ss for

Add a comment
Know the answer?
Add Answer to:
Write a C/C++ program that reads a list of words and prints them in alphabetical order...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Urgent please! This is in C. I need to write a function that reads a .txt...

    Urgent please! This is in C. I need to write a function that reads a .txt file in using fgets (line by line) and makes a linked list, with each node storing a pointer to a char array that stores one word in the line it reads. A "word" can be alphabetical, numerical, punctuation, blank lines, or \n. I have a struct: struct node { void *data; struct node *next; }; that stores a pointer to an array of chars...

  • just write the answers in a sentences. No need to explain them. THE CASE OF SEAMUS...

    just write the answers in a sentences. No need to explain them. THE CASE OF SEAMUS Seamus was born to an Irish-American family that was upper class. His mother was a nurse; his father was an up-and-coming lawyer who was already making six figures in the middle 1970’s. Seamus grew up in a beautiful house with his brother in a predominantly white neighborhood. His family also occasionally took in Seamus’s friends who were having hard times. For example, one friend...

  • Jonathan had spent his weekends and summers working at Pizza Hut throughout his teen years, as...

    Jonathan had spent his weekends and summers working at Pizza Hut throughout his teen years, as well as, in college. He had been mentored by a boss he greatly admired, who taught him the value of hiring a diverse workforce. Over those formative years, Jonathan had many opportunities to work with and befriend, people who had a variety of disabilities. After years of hard work, followed by a series of promotions, Jonathan had become a Medical Office Administrator and decided...

  • Choose a symbol from either "The Gift of the Magi" and discuss what significance this symbol...

    Choose a symbol from either "The Gift of the Magi" and discuss what significance this symbol had to you as the reader (an example of this would be the combs Jim gave to Della and a discussion about a precious gift that you received or gave). Use text examples in this section. If someone were to write your life story, what symbol would be present and why?  How does this symbol represent you?   You can attach a picture of your symbol (an...

  • Cultural critic Laura Kipnis writes, “If Frey, an aspiring novelist, harnessed himself to the engine of...

    Cultural critic Laura Kipnis writes, “If Frey, an aspiring novelist, harnessed himself to the engine of the recovery narrative to get his story into print, his readers compromised themselves too, swallowing his writerly affectations like pills mashed up in applesauce, so eager for a fix of recovery lit that the eye-blinking grandiosities [of the book] barely registered.” Do you agree with this statement? Why or why not? answer 200 words A Million Little Pieces In 2003, publisher Doubleday released James...

  • case study CASE STUDY A Study of the Nursing Situation I was still a student and...

    case study CASE STUDY A Study of the Nursing Situation I was still a student and being mentored by an experienced and loving oncology nurse. She inspired confidence in me with her quiet wisdom and gentle spirit. During one practicum, we paused bricfly outside a patient's room where the door was almost closed. My mentor placed a syringe in my hand, explained its contents, and instructed me to give an IV push to her patient Diane, inside the room. She...

  • Instructions: Each of the following 12 scenarios illustrates one of Freud’s defense mechanisms from the list...

    Instructions: Each of the following 12 scenarios illustrates one of Freud’s defense mechanisms from the list below. Select your answers from the defense mechanisms listed below. Read each case, identify the defense mechanism, and explain how it is illustrated by the example (1⁄2 point for correctly identifying the defense mechanism, 1⁄2 point for correct explanation = 12 points total). See pages 40-41 in the lab manual as well as the textbook and powerpoint for definitions and examples. Name Lab Day...

  • Using the IRAC Method I need help answering this: Background: Hiro is an employee of the...

    Using the IRAC Method I need help answering this: Background: Hiro is an employee of the Federal Bank of Australia (FBA) and works in the consumer lending division. FBA is currently running a competition with its consumer lenders with first prize being a $25,000.00 bonus at the end of the year. Hiro is very keen for the bonus and decides to speak to his grandmother and an ex-girlfriend of his about arranging loans to boost his sales figures. Hiro hadn’t...

  • Identify the name of the book or play from which each quote is taken: A) “He...

    Identify the name of the book or play from which each quote is taken: A) “He was there below me, and, upon my word, to look at him was as edifying as seeing a dog in a parody of breeches and a feather hat, walking on his hind-legs.” B) “I have done the state some service, and they know’t.” C) “I told myself that even if my house had burned to the ground while I was away, even if my...

  • Case study (questions 1-4) Jeremy is 32 and for the last six months he has been...

    Case study (questions 1-4) Jeremy is 32 and for the last six months he has been living in supported accommodation around the comer from his mum's house where he had lived with her all his life. Jeremy is tall, well-built and has moderate intellectual disability. His mum, Ruby, is still his guardian and loves him tremendously. She did everything for him all his life before age and various health conditions meant that she could no longer properly support him. Consequently,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT