[SOLVED] CPD Exercise # 2

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon EX2-k85hqh.zip (65.5 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
Rate this product

 

Exercise #2

Let’s continue to extend the program that can do word replacement in an article(ie. Exercise #1). Please add at least three parameterized macros in the program and these parameterized macros need handle critical parts related to the output. The trivial parameterized macros like #define PRINT(n) printf(“%s”, n) will not be included in the three parameterized macros.

Moreover, you need to use the conditional compilation as a debugging tool. When the program is in the debug mode, you must show the information like the table of output below.

The table below shows the example input and output. The underscored number is the input from users.

Input Output
Enter pattern, replacement, and at most one parameter: he it Enter the article:

The debug test.

this is case 0 the word is: The Tit the word is: debug the word is: test
Enter pattern, replacement, and at most one parameter: he it -i Enter the article:

The debug test.

this is case 1 the word is: The Tit the word is: debug the word is: test
Enter pattern, replacement, and at most one parameter: he The input format: string1 string2 [parameter]

2

  • EX2-k85hqh.zip