week 5

week 5

The purpose of this assignment is to gain experience with input validation.
• Review the Database of Employee Stock Purchase Program.doc file (in Blackboard) to see the database schema for a new software development project that will allow employees to purchase stock electronically.
• Assume that the database schema has been created accurately based on conversations with an analyst who provided the appropriate business logic.
• Note the field EMP_ID in the Employee table in the database schema. This is the field that will hold the employee ID number. Note that the schema indicates that this field is the primary key of the Employee table (which means it is a required field) and that its expected data type is CHAR(7), which means it can hold a maximum of 7 alphanumeric characters.
• You have been told that the EMP_ID field will be populated by a third-party application (the company’s Human Resources software system). So, the EMP_ID field will be an input value to this software system, and as such, it will require input validation.

Based on the information given above:
• Code a data cleansing algorithm in a programming language of your choice that will validate the input field EMP_ID. Your algorithm should incorporate the use of a Boolean (true/false) variable called isValid that must be set to either true or false at the end of your algorithm to indicate whether the input value is valid (meets the input requirements) or not.
• Please note the programming language used in your solution. For example, “I wrote a data cleansing algorithm in Java, as follows:” (followed by your solution).

The purpose of this assignment is to gain experience with input validation.
• Review the Database of Employee Stock Purchase Program.doc file (in Blackboard) to see the database schema for a new software development project that will allow employees to purchase stock electronically.
• Assume that the database schema has been created accurately based on conversations with an analyst who provided the appropriate business logic.
• Note the field EMP_ID in the Employee table in the database schema. This is the field that will hold the employee ID number. Note that the schema indicates that this field is the primary key of the Employee table (which means it is a required field) and that its expected data type is CHAR(7), which means it can hold a maximum of 7 alphanumeric characters.
• You have been told that the EMP_ID field will be populated by a third-party application (the company’s Human Resources software system). So, the EMP_ID field will be an input value to this software system, and as such, it will require input validation.

Based on the information given above:
• Code a data cleansing algorithm in a programming language of your choice that will validate the input field EMP_ID. Your algorithm should incorporate the use of a Boolean (true/false) variable called isValid that must be set to either true or false at the end of your algorithm to indicate whether the input value is valid (meets the input requirements) or not.
• Please note the programming language used in your solution. For example, “I wrote a data cleansing algorithm in Java, as follows:” (followed by your solution).