CorrectFormationCreate a program and locally declare in main fname and Iname and completeName. Ask the user for their first and last name. Putthe values into fname and Iname. You will create a function that is called as followedjoinNames( fname, Iname, completeName);You will pass the first name array, the last name array, and the array that will contain the complete name. The function namedjoinNames should put the first and last names together in completeName. Make sure that the first and last names begin withcapital letters, and that all others are lower case. Display the final combined namePlease enter your first name:chuck wagonPlease enter your last name: The complete name is Chuck WagonProcess returned θ (8x0) execution time : 5.192 sPress any key to continue.

Question
Asked Mar 14, 2019
9 views

Programming in C 

CorrectFormation
Create a program and locally declare in main fname and Iname and completeName. Ask the user for their first and last name. Put
the values into fname and Iname. You will create a function that is called as followed
joinNames( fname, Iname, completeName);
You will pass the first name array, the last name array, and the array that will contain the complete name. The function named
joinNames should put the first and last names together in completeName. Make sure that the first and last names begin with
capital letters, and that all others are lower case. Display the final combined name
Please enter your first name:chuck wagon
Please enter your last name: The complete name is Chuck Wagon
Process returned θ (8x0) execution time : 5.192 s
Press any key to continue.
help_outline

Image Transcriptionclose

CorrectFormation Create a program and locally declare in main fname and Iname and completeName. Ask the user for their first and last name. Put the values into fname and Iname. You will create a function that is called as followed joinNames( fname, Iname, completeName); You will pass the first name array, the last name array, and the array that will contain the complete name. The function named joinNames should put the first and last names together in completeName. Make sure that the first and last names begin with capital letters, and that all others are lower case. Display the final combined name Please enter your first name:chuck wagon Please enter your last name: The complete name is Chuck Wagon Process returned θ (8x0) execution time : 5.192 s Press any key to continue.

fullscreen
check_circle

Expert Answer

Step 1

The program would have the following steps:

  1. Declare the arrays to accept the user input and the array to contain the final output
  2. Accept the input from the user
  3. Call the function joinNames passing it the input and output arrays as paramaters
  4. Inside the function convert the names to title case and concatenate into the output array
  5. Return from the function and print the output array
Step 2

The C program for the same is:

#include <stdio.h>

#include <string.h>

 

 

void joinNames(char fname[],char lname[],char flname[] ) {

    if((fname[0]>='a' && fname[0]<='z'))

                                                fname[0]=fname[0]-32;

    if((lname[0]>='a' && lname[0]<='z'))

                                             ...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you

Show more Q&A add
question_answer

Q: Write a java program called Sales considering the following directions and the sample run. Practice ...

A: The program has the following steps:Declare the variablesReceive the input from the userCalculate th...

question_answer

Q: Write a program called LoopMinMax that reads in 4 values from the user and prints the lowest and hig...

A: You didn’t mention which language should be used for the given program. Here, I have used JAVA langu...

question_answer

Q: write a program that reads a line of text and then displays the line, but with the first occurrence...

A: Given below program reads the first occurrence of “hate” and displays “love “ in place of “hate”.

question_answer

Q: Show that there exists an algorithm to determine whether λ ∈ L for any regular language L.

A: DFA (Deterministic Finite Automation):For a given state on a given input, user reach to a determinis...

question_answer

Q: This table is in 1NF. What does the table look like in 3NF? This is about Normalization.

A: First to make the table clears 3NF we need to understand what is Normal form.* Basically normal form...

question_answer

Q: Read in 5 letters from the keyboard, reverse the order of the second and next to last letters, and p...

A: Pseudocode is an informal approach of programming description that does not need any exact programmi...

question_answer

Q: A Maze Room : In this lab, we will make a maze game. The maze is based on Linked Lists. Instead of h...

A: For class Room, implement the setter and getter methods by assign and returning values respectively....

question_answer

Q: How do I get this flat list table into 1NF, 2NF and 3NF?

A: Normalization:Normalization is a process of dividing the tables by more than one idea into set of ta...

question_answer

Q: Use eclipse for these methods

A: Solution:Given data,The java code to display the output for method calls using the method overloadin...