{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


Mechatronics_C__Assignment - alphabetic order The user...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Swinburne University of Technology Faculty of Engineering and Industrial Sciences HES1300 Assignment Using C Language Submission is due during the lab sessions in week 11 (17-21 of May) Write a program in C language that reads an arbitrary (but limited to 10) number of words (of not more than 100 characters each), one per line, from the standard input (terminal window or a file depending on the user request) and insert them into an array in lexicographic (alphabetic) order. The input is terminated by reaching the end of file or entering the Ctrl-Z (end of file in DOS) character (Ctrl-Z needs to be entered twice!). Once the input is terminated, the program needs to iterate over the array and print out each word, one word per line. So, the output should just be the input words in
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: alphabetic order. The user should be given the opportunity of deciding if the outcome is to be printed to the computer screen or to a chosen text file. Properly commented, well structured, nicely formatted code is important. Implementing a number of simple, small functions to do things like read a word, compare two words, insert into the array by generating a space, etc are highly recommended. Use the following examples to test your program. Save your code using the following convention: firstname_surname_studentID.c and submit the file via blackboard DigitalDropBox before the end of your lab on week 11 (make sure that you show your program to your lab tutor as well). 1. the small red fox jumped over the tall fence 2. Hello Is Anyone Out There 3. a b c . . . z 4. z y x . . . a...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online