Question: 6 . 2 0 LAB: Login name Write a program that creates a login name for a user, given the user's first name, last name,
LAB: Login name
Write a program that creates a login name for a user, given the user's first name, last name, and a fourdigit integer as input. Output the login name, which is made up of the first six letters of the first name, followed by the first letter of the last name, an underscore and then the last digit of the number use the operator If the first name has less than six letters, then use all letters of the first name. Assume the first name and last name have a maximum of characters.
Hint: Make a new string, copy the characters from the first, last names, and underscore into the new string, and output the new string as part of the output. Don't forget to add a null character at the end of the new string after you have finished copying the characters.
Ex: If the input is:
Michael Jordan
the output is:
Your login name: MichaeJ
Ex: If the input is:
Nicole Smith
the output is:
Your login name: NicoleS
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
