Ethan O.

asked • 01/26/20

Please help me program the two functions

Write the code using C


  1. Write a function that asks for the user's first, middle, and last names. The names will be entered by the user on a single line and will be stored in three different C-strings. The program should then store, in a fourth array, the name arranged in the following manner: the last name followed by a comma and a space, followed by the first name and a space, followed by the middle name. For example, if the user entered Carol Lynn Smith, it should store Smith, Carol Lynn in the fourth array. Display the contents of the fourth array on the screen. You can assume that each individual name will be no more than 20 characters. (remember to have space for the null terminator as well)
  2. Write a function that asks for a password and then verifies that it meets the criteria below. If it doesn't meet the specifications, the program should display a specific error message telling the user why the password is invalid.

Criteria:

  1. between 6 and 14 characters long
  2. at least one uppercase and one lowercase character
  3. at least 1 digit
  4. at least one punctuation symbol

3. Combine the functions in a single driver program that checks that both functions work properly.

1 Expert Answer

By:

Patrick B. answered • 01/26/20

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.