Please create a program answering the following question in C PROGRAMMING.
Program:
#include <stdio.h>
#include <string.h>
int main(void) {
char fname[100],lname[100],completename[100];
printf("Please enter your first name:");
scanf("%[^\n]s",fname);
printf("Please enter your last name:");
scanf("%[^\n]s",lname);
joinNames(fname,lname,completename);
return 0;
}
void joinNames(char f[],char l[],char c[])
{
int i;
strcat(f, l);
strcat(c, f);
for(i=0; c[i]!='\0'; i++)
{
//check first character is lowercase alphabet
if(i==0)
{
if((c[i]>='a' && c[i]<='z'))
c[i]=c[i]-32; //subtract 32 to make it capital
continue; //continue to the loop
}
if(c[i]==' ')//check space
{
//if space is found, check next character
++i;
//check next character is lowercase alphabet
if(c[i]>='a' && c[i]<='z')
{
c[i]=c[i]-32; //subtract 32 to make it capital
continue; //continue to the loop
}
}
else
{
//all other uppercase characters should be in lowercase
if(c[i]>='A' && c[i]<='Z')
c[i]=c[i]+32; //subtract 32 to make it small/lowercase
}
}
printf("The completename is: %s\n",c);
}
Please create a program answering the following question in C PROGRAMMING. CorrectFormation Create a program and...
Please create a program answering the following question. In C PROGRAMMING! Contactlnformation Create a program with the following requirements 1. You must have a data structure for personal contact information 2. Declare one of your contact information data structures locally in main 3. Create a function that allows users to enter in all of the information that populates the data structure that was passed in 4. Create a function that displays the information that was entered into the data structure...
Write a C++ program that produces the following output: /* OUTPUT Enter your age: 21 Enter the last name: Lee Hello Tom Lee. You are 21 years old. Press any key */ Declare an array named: firstName The array is a c_string, i.e., it is a null-terminated character array. The size of the array is 10. Assign a first name to it when it is declared. Declare an array named: lastName The array is a c_string, The size of the...
Using C Programming, Write a program that prompts for the user's first and last names. Declare a third array that will hold the user's last name and first name, separated by a comma and space. Use loops to inter through the names one character at a time, storing them into the full name array. Don't forget about the terminating character. Sample run: Enter your first name: john Enter your last name: matthews First name: John Last name: Matthews Full name:...
c++ Instructions Overview In this programming challenge you will create a program to handle student test scores. You will have three tasks to complete in this challenge. Instructions Task 1 Write a program that allocates an array large enough to hold 5 student test scores. Once all the scores are entered, the array should be passed to a function that sorts them in ascending order. Another function should be called that calculates the average score. The program should display the...
ASSIGNMENT: Create a program to do the following: BONUS: A bonus of 20 points if you create the program in such a way that there is no limit on the number of names to be handled. 1) Read in names to sort until the user types the “enter” key as the first character of a “C-type” string (the maximum number of names is 20, there is not a maximum length to a name), using a two dimensional array of characters....
Q1) C-Programming Create a C program to declare an array of 5 pointers to strings and to allocate the exact memory needed to store strings of less than 8 characters. The program should read 5 strings and display the longest one. If more than one string is the longest, the program is to display the one found first.
USING RAPTOR For the following Programming Challenges, use the modular approach and pseudocode to design a suitable program to solve it. Create a program that allows the user to input a list of first names into one array and last names into a parallel array. Input should be terminated when the user enters a sentinel character. The output should be a list of email addresses where the address is of the following from: [email protected]
Please write this program in C++, thanks Task 9.3 Write a complete C++ program to create a music player Your program should read in several album names, each album has up to 5 tracks as well as a genre. First declare genre for the album as an enumeration with at least three entries. Then declare an album structure that has five elements to hold the album name, genre, number of tracks, name of those tracks and track location. You can...
C programming. please include comments In this lab, you will learn to read data from and write data to a file - another use for pointers. SAMPLE PROGRAM There are two sample programs this week - WriteFile.c and ReadFile.c. The first, WriteFile.c, allows the user to enter customer names (first, middle, and last), and writes each name to an output text file, customerNames.txt. formatted as: firstName middlelnitial lastName" After you've run it once, what happens to the names you added...
I Need Help with this using Java Programming : Class name fname lname Class variable total Number Constructor (no arguments) Constructor (takes two arguments, fname and lname) One getter method to return the fname and lname One setter method for fname and lname Inside Main: Create three objects with the following names Jill Doe John James Jack Smith When creating the first object (Should not be an anonymous object) use the argument-less constructor Then use the setter method to assign...