Question

lor the Absolute Beginner. Third The struen Edition up to the action takes a refe to a string returns the numeric stri NULL The fun ing character, but not including the NULL character engh and tolower( and touppero are used to convert a single character to case uppercase, respectively. The strcpy function contents of one string into another The strcat copi or ues one string to another function con The s function is used to compare two strings for equality, trcmp() create a program that performs the following functions: Uses character arrays to read a users name from standard input Tells the user how many characters are in her name Displays the users name in uppercase 2. Create a program that uses the strstr() function to search the string When the going gets tough, the tough stay put! for the following occurrences (display each rrence found to standard output): Going tou ay put 3. Build a program that uses an array of strings to store the following names: Florida Oregon California Georgia Using the preceding array of strings, write your own sort function to display each stat name in alphabetical order using the strcmp function. 4. Modify the word Find game to include one or more of the following suggestions Add a menu to the word Find game that allows the user select a level of such as beginning, intermediate, and advanced. The number of seconds the user to guess or the length of the text in which the user will look for words could deter the level of difficulty. Incorporate multiple words into the text areas. Track the players score. For example, add 1 point for each word guessed c or and subtract 1 point for each word guessed incorrectly. Use the strlen function to Problem #1
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h>
#include <string.h>

#define MAX 100

// Capitaliza the String
void capitalize(char *name, int size) {
int i=0;
for(i=0; i<size; i++) {
name[i] = toupper(name[i]);
}
}

// Driver function
int main()
{
// to store the name
char name[MAX];
  
printf("Enter the name: ");
scanf(" %[^\n]",name);

// Capitalize the stirng now
capitalize(name, strlen(name));
  
printf("\nYour name contains %d characters.\n", strlen(name));
printf("Your name in uppercase: %s\n", name);
return 0;
}

Add a comment
Know the answer?
Add Answer to:
Problem #1 Create a program that performs the following functions: Uses character arrays to read a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Note wordBank, an array of 10 strings (char *s). Your program should do the following: 1....

    Note wordBank, an array of 10 strings (char *s). Your program should do the following: 1. Select a word at random from the wordBank. This is done for you. 2. On each turn display the word, with letters not yet guessed showing as *'s, and letters that have been guessed showing in their correct location 3. The user should have 10 attempts (?lives?). Each unsuccessful guess costs one attempt. Successful guesses do NOT count as a turn. 4. You must...

  • Create a program that stores words in an STL vector and then searches the vector for...

    Create a program that stores words in an STL vector and then searches the vector for words. Requirements You will keep track of strings as C++ string objects. In main, declare a vector variable to contain your strings. Create a loop that gets one word at a time from the user until they enter "." as the only thing on the input line. For this assignment, it is adequate to limit strings to one word at a time. Put the...

  • Write C++ program (studentsGpa.cpp) uses dynamic allocation to create an array of strings. It asks the...

    Write C++ program (studentsGpa.cpp) uses dynamic allocation to create an array of strings. It asks the user to enter a number and based on the entered number it allocates the array size. Then based on that number it asks the user that many times to enter student’s names. What you need to do:  Add another array of doubles to store the gpa of each student as you enter them  You need to display both the student’s name and...

  • Please Write CLEARLY Create a program that uses functions and arrays that performs the following: Creates...

    Please Write CLEARLY Create a program that uses functions and arrays that performs the following: Creates a report to display to the user containing the following information: o Accept user input for a starting number o determine whether or not the entered number is prime or not o find the next 20 prime numbers after your selected numbers o display your results This can be created either using the console application as we've done in class or as a windows...

  • In Java. Write a GUI contact list application. The program should allow you to input names...

    In Java. Write a GUI contact list application. The program should allow you to input names and phone numbers. You should also be able to input a name and have it display the previously entered phone number. The GUI should look something like the following, although you are welcome to format it in any way that works. This should be a GUI application with a JFrame. The program should contain two arrays of Strings. One array will contain a list...

  • I have to use java programs using netbeans. this course is introduction to java programming so...

    I have to use java programs using netbeans. this course is introduction to java programming so i have to write it in a simple way using till chapter 6 (arrays) you can use (loops , methods , arrays) You will implement a menu-based system for Hangman Game. Hangman is a popular game that allows one player to choose a word and another player to guess it one letter at a time. Implement your system to perform the following tasks: Design...

  • In this lab you will write a spell check program. The program has two input files:...

    In this lab you will write a spell check program. The program has two input files: one is the dictionary (a list of valid words) and the other is the document to be spellchecked. The program will read in the words for the dictionary, then will read the document and check whether each word is found in the dictionary. If not, the user will be prompted to leave the word as is or type in a replacement word and add...

  • For a C program hangman game: Create the function int play_game [play_game ( Game *g )]...

    For a C program hangman game: Create the function int play_game [play_game ( Game *g )] for a C program hangman game. (The existing code for other functions and the program is below, along with what the function needs to do) (Also the link to program files (hangman.h and library file) is below the existing code section. You can use that to check if the code works) What int play_game needs to do mostly involves calling other functions you've already...

  • Please help with this Intro to programming in C assignment! Intro to Programming in C-Large Program...

    Please help with this Intro to programming in C assignment! Intro to Programming in C-Large Program 3 - Hangman Game Assignment purpose: User defined functions, character arrays, c style string member functions Write an interactive program that will allow a user to play the game of Hangman. You will need to: e You will use four character arrays: o one for the word to be guessed (solution) o one for the word in progress (starword) o one for all of...

  • Create a script that presents a word guessing game. Allow users to guess the word letter-by-letter by entering a character in a form. Start by assigning a secret word to a variable named $secret. Afte...

    Create a script that presents a word guessing game. Allow users to guess the word letter-by-letter by entering a character in a form. Start by assigning a secret word to a variable named $secret. After each guess, print the word using asterisks for each remaining letter but fill in the letters that the user guessed correctly. You need to store the user’s guess in a hidden text field name $hidden_guess. For example, if the word you want users to guess...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT