Starting from:

$25

CSC3320 -  Systems Programming - Homework# 4 - Solved

PART 1: 40pts

Must incorporate use of Functions and Pointers 

 

1.   Write a C program checkPasswd.c to check if the length of a given password string is 10 characters or not. If not, deduct 5 points per missing character. If the total deduction is greater than 30 points, print out the deduction and message "The password is unsafe! Please reset."; otherwise, print out "The password is safe."

 2.   Similar to above question, update the C program checkPasswd.c to check if a password is safe or by not by checking only the evaluation criteria below. It will still print out the final score, and "safe" or "unsafe" when deduction is more than 30 points.

●     Missing lower case                                                          -20 points

●     Lack of capital letters                                                      -20 points

●     Missing numbers                                                             -20 points

●     More than 2 consecutive characters (e.g. 123 or abc)  -20 points

 Part II : 40pts

Must incorporate the use of Functions and Pointer arrays

 

3.   Write a program that reads a message (can be characters, numeric or alphanumeric) and checks whether it is a palindrome (the characters in the message are the same when read from left-to-right or right-to-left).

 4.   Write a program that will swap two variables without the use of any third variable. Utilize this program to write a program that reads two sentences that contain alphanumeric characters and the program must swap all the numerics in sentence1  with alphabet characters from sentence 2 and vice-versa. Keep the lengths of the sentences as identical.

 Part III : 20pts

Must incorporate Functions, Pointers or PointerArrays, and Structures or Unions

 

5.   Write a program that asks the user to enter an international dialing code and then looks it up in the country_codes array (see Sec 16.3 in C textbook). If it finds the code, the program should display the name of the corresponding country; if not, the program should print an error message. For demonstration purposes have at least 20 countries in your list
 

More products