I need help in creating 5 user defined function in C to solve the following problem as shown in the screenshot. Below is the skeleton code for the problem. The 5 user defined functions need to be created in accordance to the screenshot and should be tested in the int main function.      The Skeleton Code #include #include typedef char String30[31]; typedef char String60[61]; /*     TO DO:           Implement the functions as specified in screenshot above          RESTRICTIONS:     1. Do NOT call printf() or scanf() in any of the required function definition        EXCEPT in the main() function.      */ /*     Step 1: Define the function that will achieve this step right after this comment.             Do NOT call print(), scanf() and any  other library functions not indicated above. User defined function has to be made in accordance to step 1 in the screenshot */ /*     Step 2: Define the function that will achieve this step right after this comment.             Do NOT call print(), scanf() and other library functions that we did not            discuss in class. User defined function has to be made in accordance to step 2 in the screenshot */ /*     Step 3: Define the function that will achieve this step right after this comment.             Do NOT call print(), scanf() and other library functions that we did not            discuss in class. User defined function has to be made in accordance to step 3 in the screenshot */ /*     Step 4: Define the function that will achieve this step right after this comment.             Do NOT call print(), scanf() and other library functions that we did not            discuss in class. User defined function has to be made in accordance to step 4 in the screenshot */ /*     Step 5: Define the function that will achieve this step right after this comment.             Do NOT call print(), scanf() and other library functions that we did not            discuss in class. User defined function has to be made in accordance to step 5 in the screenshot */ int main() {     String30 firstName, lastName;     String60 password;          // Do NOT add any printf() for prompts before the scanf() function calls.     scanf("%s", firstName);     scanf("%s", lastName);               // Call Step 1 function after this comment and before the printf() statement.     printf("%s\n", password);  // prints the password value after step 1.               // Call Step 1 function after this comment and before the printf() statement.          printf("%s\n", password)  // prints the password value after step 1.               // Call Step 2 function after this comment and before the printf() statement.          printf("%s\n", password);  // prints the password value after step 2.               // Call Step 3 function after this comment and before the printf() statement.          printf("%s\n", password);  // prints the password value after step 3.               // Call Step 4 function after this comment and before the printf() statement.          printf("%s\n", password);  // prints the password value after step 4.               // Call Step 5 function after this comment and before the printf() statement.          printf("%s\n", password);  // prints the FINAL password value after step 5.          return 0; }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

I need help in creating 5 user defined function in C to solve the following problem as shown in the screenshot. Below is the skeleton code for the problem. The 5 user defined functions need to be created in accordance to the screenshot and should be tested in the int main function.   

 

The Skeleton Code

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

typedef char String30[31];
typedef char String60[61];

/*
    TO DO: 
    
    Implement the functions as specified in screenshot above
    
    RESTRICTIONS:
    1. Do NOT call printf() or scanf() in any of the required function definition
       EXCEPT in the main() function.
    
*/


/* 
   Step 1: Define the function that will achieve this step right after this comment. 
           Do NOT call print(), scanf() and any  other library functions not indicated above.

User defined function has to be made in accordance to step 1 in the screenshot

*/

/* 
   Step 2: Define the function that will achieve this step right after this comment. 
           Do NOT call print(), scanf() and other library functions that we did not
           discuss in class.

User defined function has to be made in accordance to step 2 in the screenshot
*/

/* 
   Step 3: Define the function that will achieve this step right after this comment. 
           Do NOT call print(), scanf() and other library functions that we did not
           discuss in class.

User defined function has to be made in accordance to step 3 in the screenshot
*/

/* 
   Step 4: Define the function that will achieve this step right after this comment. 
           Do NOT call print(), scanf() and other library functions that we did not
           discuss in class.

User defined function has to be made in accordance to step 4 in the screenshot
*/

/* 
   Step 5: Define the function that will achieve this step right after this comment. 
           Do NOT call print(), scanf() and other library functions that we did not
           discuss in class.

User defined function has to be made in accordance to step 5 in the screenshot

*/

int main()
{
    String30 firstName, lastName;
    String60 password;
    
    // Do NOT add any printf() for prompts before the scanf() function calls.
    scanf("%s", firstName);
    scanf("%s", lastName);
    
    
    // Call Step 1 function after this comment and before the printf() statement.
    printf("%s\n", password);  // prints the password value after step 1.
    
    
    // Call Step 1 function after this comment and before the printf() statement.
    
    printf("%s\n", password)  // prints the password value after step 1.
    
    
    // Call Step 2 function after this comment and before the printf() statement.
    
    printf("%s\n", password);  // prints the password value after step 2.
    
    
    // Call Step 3 function after this comment and before the printf() statement.
    
    printf("%s\n", password);  // prints the password value after step 3.
    
    
    // Call Step 4 function after this comment and before the printf() statement.
    
    printf("%s\n", password);  // prints the password value after step 4.
    
    
    // Call Step 5 function after this comment and before the printf() statement.
    
    printf("%s\n", password);  // prints the FINAL password value after step 5.
    
    return 0;
}

    
    
    

YOUR TASK: Write a C program that will automatically generate a default password given the user's Firstname and Lastname as
inputs. Both names are strings made up of lower case letters with no space in between. Follow the 5-step password generation
algorithm given in the table below. Three examples are provided to help you figure out what is meant by each Instruction. The
changes in the password are shown visually in red color.
Step Instruction
Example #1:
Firstname: angelito
Lastname: mercado
Example #2:
Firstname: ron
#
Example #3:
Firstname: ik
Lastname: tar
Lastname: sy
1.
Initialize the password as a concatenation of
Firstname, underscore and Lastname.
angelito_mercado ron_sy
ik_tar
2.
angelito_mercado
ron_syza
ik_tarst
If the length of the password is less than 8, add new
characters at the end of the string such that the
length will become 8.
The new characters to be added are chosen such
that they correspond to the sequence of letters (in
the English alphabet). The sequence starts with the
next-letter-after-the-last-character in the Lastname.
If the last character is 'z', the letters to be added
cycle back to 'a'. Examples are shown in the last two
columns of this table.
Be very careful in this step. The original null byte
will be overwritten. Do NOT forget to add a null
byte in the password! Your codes for the next steps
will have a logical error when the null byte is
missing.
Angelito_Mercado Ron_Syza
Ik Tarst
Capitalize the first character of the first name and
last name.
Ang311t0_M3rc@do Ren_Syz@
Ik_T@rst
Replace lower case vowels as follows: 'a' with '@',
'e' with '3', 'i' with '1', 'o' with '0' and 'u' with '^'.
Upper case vowels should not be replaced.
Ang311?0_M3rc@de Ren_Syz@
Ik_T@r*?
Replace lower case consonants as follows: 's' with
'*', and 't' with '?'. Upper case consonants should
not be replaced.
3.
4.
5.
Transcribed Image Text:YOUR TASK: Write a C program that will automatically generate a default password given the user's Firstname and Lastname as inputs. Both names are strings made up of lower case letters with no space in between. Follow the 5-step password generation algorithm given in the table below. Three examples are provided to help you figure out what is meant by each Instruction. The changes in the password are shown visually in red color. Step Instruction Example #1: Firstname: angelito Lastname: mercado Example #2: Firstname: ron # Example #3: Firstname: ik Lastname: tar Lastname: sy 1. Initialize the password as a concatenation of Firstname, underscore and Lastname. angelito_mercado ron_sy ik_tar 2. angelito_mercado ron_syza ik_tarst If the length of the password is less than 8, add new characters at the end of the string such that the length will become 8. The new characters to be added are chosen such that they correspond to the sequence of letters (in the English alphabet). The sequence starts with the next-letter-after-the-last-character in the Lastname. If the last character is 'z', the letters to be added cycle back to 'a'. Examples are shown in the last two columns of this table. Be very careful in this step. The original null byte will be overwritten. Do NOT forget to add a null byte in the password! Your codes for the next steps will have a logical error when the null byte is missing. Angelito_Mercado Ron_Syza Ik Tarst Capitalize the first character of the first name and last name. Ang311t0_M3rc@do Ren_Syz@ Ik_T@rst Replace lower case vowels as follows: 'a' with '@', 'e' with '3', 'i' with '1', 'o' with '0' and 'u' with '^'. Upper case vowels should not be replaced. Ang311?0_M3rc@de Ren_Syz@ Ik_T@r*? Replace lower case consonants as follows: 's' with '*', and 't' with '?'. Upper case consonants should not be replaced. 3. 4. 5.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY