Question: PROGRAMMING LANGUAGE IS JAVA Ticket Number Validation A ticket company is responsible for selling tickets for airlines, tours and other travel related services. Because ticket

PROGRAMMING LANGUAGE IS JAVA

PROGRAMMING LANGUAGE IS JAVA Ticket Number Validation A ticket company is responsible

Ticket Number Validation A ticket company is responsible for selling tickets for airlines, tours and other travel related services. Because ticket agents frequently mistype long ticket numbers, the company has asked you to write a program that indicates invalid ticket number entries. The program should then check for validation using the following manner: 1. Enter a number (e.g. 123454) 2. Remove the last digit (Dropping 4 results in the value 12345) 3. Determine the remainder when the ticket number is divided by 7 (in this example, 12345 divided by 7 leaves a remainder of 4) 4. If the remainder in step 3 is identical to the dropped number, then the ticket is valid. Otherwise, the ticket is invalid. (in this example, since the dropped value 4 is identical to the remainder, then this ticket number is valid.) Samples of the output are shown below: Output 1: Enter 6-digit ticket number: 147103 The ticket number 147103 is valid. lastDigit = 3 remainder = 3 Output 2: Enter 6-digit ticket number: 154123 The ticket number 154123 is invalid. lastDigit = 3 remainder = 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!