# Vita project 10 Solution

Fall 2014 Assignment #10 (50 Points)

Com S 107 follows the policies of Iowa State University regarding academic dishonesty. Please do your own work, and only discuss the assignment in general terms with other people. If you need specific help, talk to people with official ISU roles, such as the course instructor, TAs, ISU tutors. Do not share any code, ever, with another student, until at least three days after that assignment is due. Both the student sharing the code, and the student receiving the code, would be engaging in academic dishonesty. If the Dean of Students office convicts a student of academic dishonesty, the Com S 107 instructor will assign that student an F grade for the course.
Each credit card number issued by Vita Credit contains five digits. The last digit is determined by multiplying the second and fourth digit by two and then adding the products to the first and third digits. The last digit in the sum is then appended to the first four digits in the credit card number, as illustrated in following figure.
In this assignment, you are required to complete the given incomplete application which takes four digits and then calculate the fifth digit and display the credit card number. The name of the solution, project, and form file are Vita Solution, Vita Project, and Main Form.vb, respectively.
Fifth Digit Algorithm
First four digits in credit card number: 1 3 5 7
Step 1: Multiply the second and forth digits by 2: *2 *2
Result 1 6 5 14
Step 2: Add the numbers together: 1 + 6 + 5 + 14 = 26
Step 3: Take the last digit in the sum and append it to the first four digits, resulting in the final credit card number: 13576

The interface of this application is shown as follows:
The application includes following Function and Sub Procedures.
Function/Sub procedure Description exitButton_Click Define exitButton click event. firstFourTextBox_Enter Select existing text of the firstFourTextBox.
firstFourTextBox_KeyPress
Allows only numbers and the Backspace key for the firstFourTextBox. firstFourTextBox_TextChanged Clear the content of the firstFourTextBox.
creditNumberButton_Click
Define creditNumberButton click event (Determines the fifth digit in a credit card number).
You must complete the following parts in the given application.
1. Declare two String variables called creditNum, fifthDigit and an integer variable called sumOfDigits. (9 points)
2. Write code to get the value at firstFourTextBox to the variable creditNum. (5 points)
3. Fill the two blanks in if statement to check whether the creditNum is a four digit string. (6 points)
4. Write code to get the summation of four digits in variable creditNum to the variable sumOfDigit. You must follow the above given scenario to get the summation. (10 points)
5. Write code to find the fifth digit and store in the variable fifthDigit. (10 points)
6. Write code to append fifth digit to first four digits in the variable creditNum. (10 points) Submission Submit one Zip file.
Zip file: Using a zip program such as WinZip, you should make a single zip file that contains all the sub-folders and files for your VB project that you have created for your programming assignment. For example, when you create a project named "WindowsApplication1", then, Visual Basic 2012 Express creates a folder named "WindowsApplication1". The files for your form and code will be placed in this folder. You should zip this folder. When you zip this folder, you must let the zip program include all the sub-folders. Once your project folder has been zipped into a single zip file, you should rename this zip file by using the prefix "Assignment", the assignment number, an underscore and your ISU Net ID (Not ISU Card ID). For example, the zip file for assignment #1 for a student of which ISU ID is isu123 would be Assignment1_isu123.zip.