Write your array of text into file, Computer Engineering

Assignment Help:

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.


Related Discussions:- Write your array of text into file

Differentiate between compiler and interpreter, (i) Compiler and Interpret...

(i) Compiler and Interpreter: These are two types of language translators. A compiler changes the source program (user-written program) into an object code (machine language b

Explain about api s of olap, Microsoft in the late 1997 introduced a standa...

Microsoft in the late 1997 introduced a standard API called as OLE DB. After which XML was used for analysis specification and this specification was largely used by a lot of vendo

Microcomputer - controlled breadmaking machine, Q. Microcomputer - Controll...

Q. Microcomputer - Controlled Breadmaking Machine? Figure shows a simplified schematic diagram of a microcomputer-controlled breadmaking machine. A microcomputer along with its

cell array to a spreadsheet, The xlswrite function can write the contents ...

The xlswrite function can write the contents of a cell array to a spreadsheet.  A manufacturer kepts information on the weights of some parts in a cell array.  Every row stores the

Macroscopic and microscopic approaches - thermodynamics, Macroscopic and Mi...

Macroscopic and Microscopic approaches - Thermodynamics: Thermodynamic studies are undertaken by following two different approaches.  l. Macroscopic approach (Macro mean big)

Explain sr latch with nand gate, Explain SR Latch with NAND Gate? SR La...

Explain SR Latch with NAND Gate? SR Latch has two useful states: Set state, when output Q=1 and Q'=0. Reset state, when output Q=0 and Q'=1.Output Qand Q' are normally

Shell script, shell script to find the factorial of a given number using th...

shell script to find the factorial of a given number using the for loop

Name some pure object oriented languages, Some pure object oriented languag...

Some pure object oriented languages are Smalltalk, Eiffel,  Java, Sather.

Statistical technique, Ask qa survey was conducted among the residents of p...

Ask qa survey was conducted among the residents of pune city,it suburbs and the pune cantonment area.the following three pie diagrams show their respective preferences for living i

Algebraic method for simplification of boolean expressions, Define Algebrai...

Define Algebraic method for Simplification of the Boolean Expressions This method is depend on the by knowledge of the Boolean algebra. Expression can be making simpler by usin

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd