Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions 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
expand button
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
Check Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY