Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The purpose of the code is to replace some of the characters in a string. The code is supposed to look like the image provided

The purpose of the code is to replace some of the characters in a string. The code is supposed to look like the image provided below. I have most of the code written down below but I do not know how to have the program loop continuously, or the part where it says "q is not in the string".

image text in transcribed

CODE

#include #include #include #include int main(void) { char userString[26]; // This is the initial string that will be entered by the user char command[30]; // This is the command string that will be entered by the user char userReplace; // this is the letter that will be replaced int i; // this variable iterates through the lowercase loop so that the command is case insensitive char newChar; // this is the letter that will replace the initial letter int j = 0; // this variable iterates through the loop which replaces the letter printf ("Enter a string (up to 25 characters) to be transformed: "); fgets ( userString, 26, stdin); // fgets is used to read user input (max of 25 characters) while (1) { printf (" Enter your command (quit, replace all): "); // prompts the user to enter the command fgets ( command, 30, stdin); for (i = 0; i

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

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions