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
Superscalar architecture was designed to increase the speed of the scalar processor. But it has been realized it's not easy to apply. Subsequent are a number of problems faced in t

Name the four steps in pipelining. Fetch  : Read the instruction from the memory. Decode : Decode the instruction and get the source operand. Execute : Perform the operat

define about data movement

what is robot?explain different types of robots with respect to joints.

What is the difference between Commit-work and Rollback-Work tasks? Commit-Work statement "performs" many functions relevant to synchronized execution of tasks.  Rollback-work

Functioning of registers: at any instance of time global registers and only one window of registers is visible and is addressable as if it were only set of registers. So for progra

Remote Login  A login that permits a user terminal to connect to a host computer by a network or direct telecommunications link, and to interact with that host computer as if t

Q. Explain about distributed systems? A Distributed System in that Data, Process and Interface component of information System are distributed to many locations in a computer n

Somehow, the worksheet has external links to files that are no longer around. How can we delete the links? Ans) This happens all of the time to MrExcel. I downloaded a little

Q. What is Unique port number? A port is an extra 16-bit number which uniquely identifies particular service on any given machine on Internet. Port numbers are 16 bit wide, con