[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

debian



Can you give me a source code of this problem
 
IT131 Tue/Fri 7:30-9:30 am

Computer Virus Simulation (70 points)

A computer virus is a portion of computer code
designed to insert an existing computer program,
alter or destroy data, and copy itself into other programs in the same computer
or into programs of other computers.

Make a program that would simulate a computer virus
such that it see the 'the' word in a sentence,
it will substitute it with two 'the's.
Repeat this process until there are 10 or more 'the's in the sentence.
Use charAt() or substring() function to find 'the'.

Prototype Output:

Sentence: the quick brown fox jumps over the lazy dog // get this sentence using input dialog

First line: the the quick brown fox jumps over the the lazy dog // 4 'the's
Second line: the the the the quick brown fox jumps over the the the the lazy dog // 8 'the's
Third line: the the the the the the the the quick brown fox jumps over the the the the the the the the lazy dog // 16 'the's

Thanks!!


Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
Reply to: