Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please see below pics Account Validation When a passenger purchases a ticket the ticket contains an account number. Subsequently when the ticket is scanned for

please see below pics

image text in transcribed

image text in transcribed

Account Validation When a passenger purchases a ticket the ticket contains an account number. Subsequently when the ticket is scanned for entry to the transit system the account number needs to be validated. Our mechanism for validating account numbers is quite simple, the account number is eight hexadecimal digits, and to ensure validity the last two digits are a checksum which is calculated from the sum of the first six digits You will be provided a list of account numbers as input, such as BBADFeaD You should provide a line of output per line of input that states if the account number is VALID or INVALID Example: Sequence Input Output Notes 8BADF0OD INVALID 8BADFO (hex) 9154032 (decimal) - 941+5+4+0+34 2 24 24 (decimal) 18 (hex) 18-OD therefore INVALID COFFEE1C VALID COFFEE (hex) 12648430 (decimal) 1+2+6+4 8+4+3+0 28 28 (decimal) 1C (hex) 1C1C therefore VALID You may be required to return "INVALID for unexpected data. 1ort fileinput def process 1ine): 25s Line: 2 Col: 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions