Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that performs the tasks described below. Define the following functions void A ( char str [ ] ) Takes string str and

Write a program that performs the tasks described below.
Define the following functions
void A(char str[]) Takes string str and converts all non-letters to the * character
in it.
Ex: a1b2c becomes a*b*c
void B(char str[]) Swaps the first half of str with the second half of str
Ex: abcxyz becomes xyzabc
void C(char str[]) Reverses the order of the characters in the first half of str.
Ex: abcxyz becomes cbaxyz
void D(char str[]) Reverses the order of the characters in the second half of str.
Ex: abcxyz becomes abczyx
(For the functions B, C, and D, if the length of str is odd then the character in the middle of str
will not change.)
Construct two arbitrary strings and print them on the screen. They can be at any length.
o The first one will be the string that will be manipulated by the functions above.
o The second one will contain a combination of letters A, B, C, and D. The order of
these letters in the second string represents the calling order of the related
functions.
Send the first string to the first function. Then, the updated string will be sent to the next
function as a parameter. At each function call, the updated string should be printed on
the screen.
The program should terminate after all the functions in the second string are called.
NOTES:
If you need, you can implement other necessary functions in addition to the functions
above.
You cannot use any library functions other than printf();
See the example scenario below

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

1st Edition

1597496251, 978-1597496254

More Books

Students also viewed these Databases questions

Question

5. How would you describe your typical day at work?

Answered: 1 week ago

Question

7. What qualities do you see as necessary for your line of work?

Answered: 1 week ago