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
Define rotational latency and disk bandwidth. Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head. The disk bandwidth i

Diffrentiate programming tools and authoring tools Distinction between programming tools and authoring tools is not at first obvious. Though, authoring tools require less techn

Rational Testmanager is a complicated tool that can be used for automating performance tests on client/server systems. A client/server system have client applications accessing a d

HOW TO WORK IN DREAMWEAVER? How and Where to open Dreamweaver? Step 1: Click on Start Step 2: Select Program Step 3: Select Macromedia Dreamweaver Step 4: Click on

#question.Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, the

Prove the equations using the Boolean algebraic theorems that is given below A‾BC + AB‾C + ABC‾+ ABC = AB + BC + AC Ans. The equation given is A‾BC + AB‾C + ABC‾+ ABC = AB + BC +

Give an intuitive explanation of why the maximum throughput, for small beta, is approximately the same for CSMA slotted Aloha and FCFS splitting with CSMA. Show the optimal expecte

Enumerate in brief about the Intranet security policy An Intranet security policy is a very broad topic and it cannot be covered easily in few pages since it differs from situa

Requirement Specification for a Simple Application to Model a Garden The following is a requirements statement for a simple application to model the design of a garden. The requ

How can the maximum field width for a data item be specified within a scanf function? When the program is executed, three integer quantities will be entered from the standard i