This is a COBOL project. VINs or Vehicle Identification Numbers are important id
ID: 3577011 • Letter: T
Question
This is a COBOL project. VINs or Vehicle Identification Numbers are important identifiers. For example, they may enable police to determine the owner of a recovered stolen vehicle. However, the VIN must be a valid one. Write an interactive program that will check a VIN entered from the keyboard and display whether it is valid. The program must indicate why the VIN is valid and must continue to validate VINs until the user indicates that there are no more VINs to validate. The characteristics of each VIN record are as follows:
1. 17 characters long.
2. The first character must be either 1-4, J, K, S, W, or Z.
3. The tenth character must be a digit or a letter other than I, O, Q, U, or Z.
4. The last six characters must be numeric.
Explanation / Answer
01 VAR1 PIC X(4).
IF Length of VAR1 = 17 AND
IF VAR1 (1:1) = "1" OR "2" OR "3" OR "4" OR "J" OR "K" OR "S" OR "W" OR "Z"
AND VAR1 (10:1) IS NUMERIC AND VAR1 (10:1)= "I" OR "O" OR "Q" OR "U" OR "Z"
AND AR1 (11:17) IS NUMERIC
END-IF
PERFORM CALC-ROUTINE THROUGH CALC-ROUTINE-EXIT
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.