Adding Validation Programming Tasks
ONLY upload your HeAD with Code copied as text and Screenshots of console windows with the code running
You can find a template here http://pastebin.com/sZACt4dU
None of these programs are really new!! Feel free to find your old solutions are alter them if you want to... However you may find it useful to start from scratch. You will pro bally produce a better solution than before, hopefully with less effort.
75% of the marks for this assignment are purely for the VALIDATION!!! the remaining 25% are for the rest of the solution and your presentation of how you tested your program in the HeAD.
Use the Homework help forum! You need to complete 20 chips worth of problems!
- Simple Examples (10 chips)
This just a chance for you to program a simple example of each type of validation... you need to complete ALL of the following to qualify for the 10 chips.. miss one and you get zero chips). they should be programmed in a single module as separate procedures.
-
Length check
All student college email address are 22 characters long. Write a program that asks the user to enter there email address and only proceeds if it is 22 characters long -
Format Check
All college email addresses are in the format ######@godalming.ac.uk. Write a format check validation that asks the user to enter there email address and only proceeds if the first six characters are numbers and the final 16 characters = "@godalming.ac.uk" -
Range Check
The college uses the computer user-names 140001 to 149999 write a range check that ensures the inputted user name is within this range (14 is the current year) -
Type check
The college enters each students date of birth into the college database, write a very sort program that asks for the user to input a Date of birth .Use the "Try Catch" statement to ensure that the data entered is a valid date. (input as a string, then convert to a date (use cDate) -
Lookup check
If you wanted to you could limi the email address to those of this class. Create an array and hardcode it to contain 5 vaild email adresses. Write a validation to check that the input is one of those 5 emails from the array -
Presence Check
Hmmm... This is only achieved by using the same technique as a type check, ensure that the previous four examples do not crash if the user fails to enter a value (string inputs probably won't crash) -
Verification
Write a simple email verification program that asks the user to enter their email twice only allowing them to proceed if the two inputs are identical. -
Check digit
This is a simple (and not very good) check digit system for integers of length 6 digits. (5 digits of data with a single checkdigit in the least significant (smallest value) position).-
Sum the individual digits 1 to 5
Divide the number by five (this will produce a real value between 0 and 10, )
Round up to the next integer (this should be the sixth digit)
-
-
Write a program that allows the user to input a 6 digit integer and only allows them to proceed if the sixth digit obeys the above algorithm. Test you check digit program with the following numbers. 123453 231876 576485 100201 000011 999999 900002
Two of them have incorrect check digits
-
- Carpet Calculator (2 chips)
Write a program that calculates the area of carpet required for a rectangular room. You should Validate the users LENGTH and WIDTH inputs to ensure they are REAL numbers withing the range 2m --> 20m - Even Parity Check (4 chips)
Write a program that asks the user to input a binary Byte. The program should then check that there are an even number of 1's in the binary word. Validate that length = 8 digits, Format = only 1's and 0's. Checkdigit = even number of 1's - Menu Validation (3 chips)
Write a menu for the Sample Validation programs. label the programs A->G. Validate the users input to only accept a single character and only A -> G - HEX Number Validator (5 chips)
Write a program that asks the user to input a 4 digit hex number. Check the length is 4 digits and that each character is a valid hex digit -
Payroll Calculator (4 chips)
Write a payroll program that asks the user to enter how many hours they work on each day (use Mon, Tue, Wed etc..) and ask for the hourly rate, and outputs the total payment for the week. Validate that the Hours worked per day is a numeric value not over 12 hours. Also that the Hourly rate is between £4.75 and £9.90