Write your array of text into file, Computer Engineering

Part I:

1. The program starts by printing your initial with an end sign ">". For example, "cjx >";

2. Then, you can type in the following "vi filename". For example, "vi myp.c". You program will then open "myp.c" for reading. If the file does not exist, then there is nothing to read.

3. Read the file into a fixed array of "mytext[1000][ 80]". Presumably, the "myp.c" text file is not too large with each line 80 characters or fewer. If there are more in the file, just ignore.

4. Close your file if it is open.

5. Change all your texts to upper case, and display the first 80 lines on your screen.

6.  Then, your program will wait for a command from the keyboard.

7. If you type ":w", your program will open the same file for writing, and write your array of text into that file.

8. If you type ":q", your program will quite.

Part II: 

9. Replace "5. Change all your texts to upper case, and display the first 80 lines on your screen" with "Display the first 20 lines on the screen";

10. Display one special character using ascii code "176" or "178" at the position of mytext[0][0]. You are not supposed to change the array though;

11. You can use "j" to move the special character down one line, "k" up one line, "h" left one character, "l" right one character. Of course, if there is no place to move left, right, up, or down, the special character just stays.   In order to display the moved character, you may redisplay the first 20 lines again.

12. If you move beyond the first 20 lines, you should display the lines that are available with the special character at the top or bottom of the displayed 20 lines if you are moving out of the current 20 lines.

Posted Date: 2/22/2013 1:47:06 AM | Location : United States







Related Discussions:- Write your array of text into file, Assignment Help, Ask Question on Write your array of text into file, Get Answer, Expert's Help, Write your array of text into file Discussions

Write discussion on Write your array of text into file
Your posts are moderated
Related Questions
Problem (a) Explain the difference between the real mode and the protected mode in the 80x86 family of processors. (b) The 32-bit physical address 047C:0048 is to be conv

What is ternary association Associations can be binary, ternary, or have higher order. In use, the vast majority of it is binary or ternary associations. Except a ternary assoc

Define the Character Set of C Language? C uses the lower case letter a to z, the upper case letters A to Z, the digits 0 to 9 and certain characters as building blocks to form

Is it possible to create graph form spreadsheets For example IF G5 > 100 THEN "Y" ELSE "N" -  It's also possible to create graphs and charts from spreadsheets (such as using

Give explanation about the use of SSL to secure the network. SS L stands for Secure Sockets Layer is a protocol developed through Netscape for transmitting private document

The Environment variable SCRIPT_NAME in CGI script specifies? In CGI script gives the path of URL after server name.

Q. Illustrate the Execute Cycle? The fetch and indirect cycles include a small, fixed sequence of micro-operations. Every one of these cycles has fixed sequence of micro-operat

Procedure Level Here, parallelism is accessible in the form of parallel executable procedures. In this situation, the design of the algorithm plays a main role. For example eac

What is write-back or copy-back protocol? For a write operation using this protocol during write-hit: the method is to update only the cache and to mark it as updated with an a

Q. Reduce following to minimum literals and derive their complements. 1. [(AB)'A][(AB)'B] 2. ABC(ABC' + AB'C + A'BC) 3. (A+C+D) (A+C+D') (A+C'+D)(A+D')