Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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) 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.) 4. This program should use dialog boxes to output the results of the validation. You will need: . The JOptionPane class to use dialog boxes .Variables to store the ticket number, dropped digit, adjusted number and remainder (more or fewer variables may be created as needed) An if else statement to determine if the ticket is valid . A sample of the output is shown below: Output 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

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

Know how to find a consultant

Answered: 1 week ago