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
Explain a multiprocessing operating system? A multiprocessing system is a computer hardware configuration which contains more than one independent processing unit. Multiprocess

What is serialization, how it works in .NET? Serialization is when you persist the state of an object to a storage medium so an exact copy can be re-created at a later stage. S

What is phase encoding or Manchestor encoding?  It is the method for combining clock information with data. It is a scheme in which alters in magnetization occur for each data

Q. Computational Fluid Dynamics? Computational Fluid Dynamics: CFD was a FORTRAN like language developed in the early 70s at "Computational Fluid Dynamics Branch of Ames Resear

Mr. X seems to view himself in positive terms (MMPI-2: Ho=38) as a well-functioning person who is capable of dealing with his life and personal challenges (MMPI-2: LSE=41, TRT=39),

A datapool is a source of variable test data that scripts can draw from during playback

A program is to be developed to simulate the operations of a scientific calculator. List the facilities to be provided by this calculator. Analyze this using a DFD 0- level and 1-

Example of Prolog: We can say that this is also true if there are four even numbers. Now we have our first rule: • If there are three or four even numbered cards, such play

Reflexes - artificial intelligence: If an agent decides upon and executes an action in response to a sensor input without consultation of its world, then this can be considere

Name the appliances which are controlled by micro-processor Many household appliances which are microprocessor-controlled do not have operating systems (for example microwave o