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

Differences between a database index and a match code, What are the differe...

What are the differences between a Database index and a match code? Match code can have fields from several tables whereas an index can have fields from only one table.

Explain status and control registers, Q. Explain Status and Control Registe...

Q. Explain Status and Control Registers? For control of numerous operations several registers are used. These registers can't be used in data manipulation though content of som

Explain the term- looking at existing paperwork, Explain the term- Looking ...

Explain the term- Looking at existing paperwork This allows analyst to see how paper files are kept and look at operating instructions and check accounts, training manuals etc

Find minimal expression for sop. draw gate network, Q Consider the followin...

Q Consider the following expression. Assume that complement inputs are available. F(A,B,C,D) = ∑m (1,2,6,9,10,14) + ∑d (4,7,8,11,12) a. Find minimal expression for SOP. Draw

How many flip-flops are required to construct mod 30 counter, How many flip...

How many flip-flops are required to construct mod 30 counter ? Ans. Mod - 30 counter +/- requires 5 Flip-Flop as 30 5 . Mod - N counter counts overall ' N ' number of state

Explain about dual in line memory modules, Q. Explain about Dual In line Me...

Q. Explain about Dual In line Memory Modules? A DIMM is capable of delivering 64 data bits right away. Usual DIMM capacities are 64MB and up. Every DIMM has 84 gold patted conn

Explain bernstein conditions for detection of parallelism, Bernstein Condit...

Bernstein Conditions for Detection of Parallelism For execution of a number of instructions or a block of instructions in parallel, it must be made certain that instructions ar

What is uml architecture, Takes care structural and behavioural aspect of a...

Takes care structural and behavioural aspect of a software system. Contains software usage, functionality, performance, economic, reuse, and technology constraints.

Difference between perl and mod_perl, Perl is a language and MOD_PERL is a ...

Perl is a language and MOD_PERL is a module of Apache used to increase the performance of the application.

Discuss the concept of segmentation, Discuss the concept of segmentation? ...

Discuss the concept of segmentation? Segmentation is method for the non contiguous storage allocation. This is different from paging as this supports user's view of his program

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