Program 9 This assignment will have you practice the modification of strings. For this assignment you will be making a paragraph formatter. Create the following character arrays: Array “name” of...

1 answer below »


Program 9



This assignment will have you practice the modification of strings. For this assignment you will be making a paragraph formatter.


Create the following character arrays:


Array “name” of length 40 initialized to the character ‘'0’.


Array “superman” of length 80 initialized to the character ‘'0’.


The program should do the following steps.


Ask the user for a name (first and last) and store it in array name.


Using a for loop, change any upper case character in array name to lower case.


Change the first letter in array name to upper case.


Using a for loop, find the first space character in array name and change the character after it from lower case to upper case.


Place the phrase “The identity of superman is: “ in array superman using the string.h functions (do not use scanf or gets, the phrase is not inputted by the user”).


Add the string in array name to array superman without overwriting the phrase stored in it.


Display the string stored in array superman.


Exit the program.



The program run should be as follows:


Please enter a name: JoHN DoE


The identity of superman is: John Doe.





Program 9 This assignment will have you practice the modification of strings. For this assignment you will be making a paragraph formatter. Create the following character arrays: 1- Array “name” of length 40 initialized to the character ‘\0’. 2- Array “superman” of length 80 initialized to the character ‘\0’. The program should do the following steps. 1- Ask the user for a name (first and last) and store it in array name. 2- Using a for loop, change any upper case character in array name to lower case. 3- Change the first letter in array name to upper case. 4- Using a for loop, find the first space character in array name and change the character after it from lower case to upper case. 5- Place the phrase “The identity of superman is: “ in array superman using the string.h functions (do not use scanf or gets, the phrase is not inputted by the user”). 6- Add the string in array name to array superman without overwriting the phrase stored in it. 7- Display the string stored in array superman. 8- Exit the program. The program run should be as follows: Please enter a name: JoHN DoE The identity of superman is: John Doe.

Answered Same DayMay 02, 2021

Answer To: Program 9 This assignment will have you practice the modification of strings. For this assignment...

Arun Shankar answered on May 03 2021
146 Votes
#include
#include
int main(void)
{
char name[40] = {'\0'};
char superm
an[80] = {'\0'};
int i;
printf("Enter name: ");
fgets(name, 40, stdin);
for(i = 0; name[i] != '\0'; ++i)
if((name[i] >= 'A') && (name[i] <= 'Z'))
name[i] += 32;
if((name[0]...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here