1. Read first name and last name from the command line when you call the program executable. Example: testq2.exe Firstname Lastname ponte have been entered

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question
Write a C program
(L Page view
A Read aloud
V Draw
E Highlight
O Eras
Question 2: Remember only answer one question
Design and write a C program that performs the following functionality:
1. Read first name and last name from the command line when you call the program
executable. Example: testq2.exe Firstname Lastname
2. Check if sufficient number of input arguments have been entered.
3. If insufficient number of input arguments have been entered, write an error message and
exit the program by returning minus (negative) one (-1).
4. Prompt the user to enter a string. Note: the string can contain spaces.
5. Read and store the string that can contain spaces.
6. Determine the length of the string.
7. Loop through each character in the text.
8. If the character is a vowel, replace the vowel with an integer number according to the rules
in the table below:
A or a
| 1
E or e
I or i
O or o
U or u
3
4
9. Hint: if the character is a vowel, then replace with the character representation of the
number. For example, if the character is 'e', then replace 'e' with '2'.
10. Count the number of replacements of a vowel with a number
11. After checking the entered string and replacing all vowels print the first name, last name
and the string without vowels on the first line and the number of vowels on the second line
as follows:
Captain Africa - the string without vowels is: L2Trn3ng 14 pr4grlm 3s I vI151b12 132 sk3ll thIt 4p2ns m5l3pl2 cIr22rs
The string has 24 vowels
12. Return zero (0) and exit the function.
12 Add the detailed algorithm design stens in the Word document
Transcribed Image Text:(L Page view A Read aloud V Draw E Highlight O Eras Question 2: Remember only answer one question Design and write a C program that performs the following functionality: 1. Read first name and last name from the command line when you call the program executable. Example: testq2.exe Firstname Lastname 2. Check if sufficient number of input arguments have been entered. 3. If insufficient number of input arguments have been entered, write an error message and exit the program by returning minus (negative) one (-1). 4. Prompt the user to enter a string. Note: the string can contain spaces. 5. Read and store the string that can contain spaces. 6. Determine the length of the string. 7. Loop through each character in the text. 8. If the character is a vowel, replace the vowel with an integer number according to the rules in the table below: A or a | 1 E or e I or i O or o U or u 3 4 9. Hint: if the character is a vowel, then replace with the character representation of the number. For example, if the character is 'e', then replace 'e' with '2'. 10. Count the number of replacements of a vowel with a number 11. After checking the entered string and replacing all vowels print the first name, last name and the string without vowels on the first line and the number of vowels on the second line as follows: Captain Africa - the string without vowels is: L2Trn3ng 14 pr4grlm 3s I vI151b12 132 sk3ll thIt 4p2ns m5l3pl2 cIr22rs The string has 24 vowels 12. Return zero (0) and exit the function. 12 Add the detailed algorithm design stens in the Word document
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education