A program is needed to create a unique passcode for a logistics database.
A user enters a three-letter location code, a whole number representing a zone, and a decimal number representing weight.
The program must validate the location code to ensure it is exactly three characters long.
If the location code is not exactly three characters long, the program must display an error message.
If it is valid, a passcode is generated by combining:
Figure 1 shows example input values and the resulting passcode.
Enter location code: NYC
Enter zone number: 4096
Enter package weight: 12.85
Generated passcode: CYN124096
Write a program to solve this problem.