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
What is meant by common control? In several switching systems, the control subsystem may be an integral part of the switching network itself. This system is termed as direct co

State the number of definitions of firewall Though there exist a number of definitions of firewall, in simplest terms it can be defined as "a mechanism used to protect a truste

Virtual memory can be implemented with ? With Segmentation and Paging Virtual memory can be implemented.

1.  The network shown in figure 2 uses neurons with:             (a) Unipolar Binary;             (b) Bipolar Binary. Calculate a table of responses to all four possi

The grade of service is measured in (A) Percentage                                  (B)  Number (C)  Fractional Number                    (D)  Logarithmic Number  Ans

Does the use of wire-center have any influence on the performance of a token ring? Explain. One problem along with a ring network is as if the cable breaks somewhere, the ring

Q. Explain salient points about indirect addressing? A number of salient points about this scheme are:  In this addressing scheme effective address EA and contents of th

There are couple of benefit of LINQ over stored procedures.   1. Debugging - It is really very difficult to debug the Stored procedure but as LINQ is part of .NET, you can us

If two base classes have no overlapping methods or data they are said to be independent of, or orthogonal to each other. Orthogonal in the sense means that two classes function in

What are interacting processes? Interacting processes: The concurrent processes executing into the operating system are cooperating or interacting processes if they can be af