Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Ticket Number Validation A ticket company is responsible for selling tickets for airlines, tours and other travel related services. Because ticket agents frequently mistype

image text in transcribed

Java

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

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

We are of the conviction that writing is important.

Answered: 1 week ago

Question

For living, I require money.

Answered: 1 week ago