HEY TI CODE TO SO NONCODEOF NOSE AS AOM. Reza Enterprises sells tickets for buses, tours, and other travel services. Because Reza frequently mistypes long ticket numbers, Reza Enterprises has asked his students to write an application that shows if a ticket is invalid. Your application/ program tells the ticket agent to enter a six-digit ticket number. Ticket numbers are designed so that if you lose the last digit of the number, then divide by 7, the remainder of the division is exactly the same to the last dropped digit. This process is shown below: Step 1: Enter the ticket number; for example 123454 Step 2: Remove the last digit, leaving 12345 Step 3: Determine the remainder when the ticket number from step 2 is divided by 7. In this case, 12345 divided by 7 leaves a remainder of 4. Step 4: Display a message to the ticket agent indicating whether the ticket number is valid or not. If the ticket number is valid, save the number to a .txt file called "tickets.txt" and continue to loop your program asking the user if they want to continue. If the user chooses not to continue, the program will terminate/exit. If the user decides to continue, the program will repeat the above steps until the user decides to quit the program. Every time a ticket is valid, append the number to the end of the text file, if the number is not valid, do not append it in the file. Furthermore, if a given ticket number is already present inside of the text file (a search needs to be made), do not append it nor add it in the file. Test your application with the following ticket numbers: - 123454; is a valid ticket number - 147103; is a valid ticket number - 154123; is not a valid ticket number

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

 

To rt z98. 

 

HEY TI CODE TO SO NONCODEOF NOSE AS AOM.
Reza Enterprises sells tickets for buses, tours, and other travel services. Because Reza frequently mistypes long ticket
numbers, Reza Enterprises has asked his students to write an application that shows if a ticket is invalid. Your application/
program tells the ticket agent to enter a six-digit ticket number. Ticket numbers are designed so that if you lose the last digit of
the number, then divide by 7, the remainder of the division is exactly the same to the last dropped digit. This process is shown
below:
Step 1: Enter the ticket number; for example 123454
Step 2: Remove the last digit, leaving 12345
Step 3: Determine the remainder when the ticket number from step 2 is divided by 7. In this case, 12345 divided by 7 leaves a
remainder of 4.
Step 4: Display a message to the ticket agent indicating whether the ticket number is valid or not. If the ticket number is valid,
save the number to a .txt file called "tickets.txt" and continue to loop your program asking the user if they want to continue. If
the user chooses not to continue, the program will terminate/exit. If the user decides to continue, the program will repeat the
above steps until the user decides to quit the program. Every time a ticket is valid, append the num to the end the text
file, if the number is not valid, do not append it in the file. Furthermore, if a given ticket number is already present inside of the
text file (a search needs to be made), do not append it nor add it in the file.
Test your application with the following ticket numbers:
- 123454; is a valid ticket number
-147103; is a valid ticket number
- 154123; is not a valid ticket number
Transcribed Image Text:HEY TI CODE TO SO NONCODEOF NOSE AS AOM. Reza Enterprises sells tickets for buses, tours, and other travel services. Because Reza frequently mistypes long ticket numbers, Reza Enterprises has asked his students to write an application that shows if a ticket is invalid. Your application/ program tells the ticket agent to enter a six-digit ticket number. Ticket numbers are designed so that if you lose the last digit of the number, then divide by 7, the remainder of the division is exactly the same to the last dropped digit. This process is shown below: Step 1: Enter the ticket number; for example 123454 Step 2: Remove the last digit, leaving 12345 Step 3: Determine the remainder when the ticket number from step 2 is divided by 7. In this case, 12345 divided by 7 leaves a remainder of 4. Step 4: Display a message to the ticket agent indicating whether the ticket number is valid or not. If the ticket number is valid, save the number to a .txt file called "tickets.txt" and continue to loop your program asking the user if they want to continue. If the user chooses not to continue, the program will terminate/exit. If the user decides to continue, the program will repeat the above steps until the user decides to quit the program. Every time a ticket is valid, append the num to the end the text file, if the number is not valid, do not append it in the file. Furthermore, if a given ticket number is already present inside of the text file (a search needs to be made), do not append it nor add it in the file. Test your application with the following ticket numbers: - 123454; is a valid ticket number -147103; is a valid ticket number - 154123; is not a valid ticket number
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY