Write a program that lets the user enter a charge account number. The program should determine if the number is valid by checking for it in the following list: 5658845 4520125 7895122 8777541 8451277 1302850 8080152 4562555 5552012 5050552 7825877 7881200 1250255 1005231 6545231 3852085 7576651 4581002 Initialize a one-dimensional array with these values. Then use a simple linear search to locate the number entered by the user. If the user enters a number that is in the array, the program should display a message saying the number is valid. If the user enters a number not in the array, the program should display a message indicating it is invalid.
Write a program that lets the user enter a charge account number. The program should determine if the number is valid by checking for it in the following list: 5658845 4520125 7895122 8777541 8451277 1302850 8080152 4562555 5552012 5050552 7825877 7881200 1250255 1005231 6545231 3852085 7576651 4581002 Initialize a one-dimensional array with these values. Then use a simple linear search to locate the number entered by the user. If the user enters a number that is in the array, the program should display a message saying the number is valid. If the user enters a number not in the array, the program should display a message indicating it is invalid.
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
Related questions
Question
![Write a program that lets the user enter a charge account number. The program should
determine if the number is valid by checking for it in the following list:
5658845
4520125
7895122
8777541
8451277
1302850
8080152
4562555
5552012
5050552
7825877
7881200
1250255
1005231
6545231
3852085
7576651
4581002
Initialize a one-dimensional array with these values. Then use a simple linear search to
locate the number entered by the user. If the user enters a number that is in the array, the
program should display a message saying the number is valid. If the user enters a number
not in the array, the program should display a message indicating it is invalid.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fc0e2bc7d-7b71-4dc1-871d-f66b1c98b584%2Fe300246e-5623-4d13-9efd-58d44062ff33%2Ffaifl0g_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Write a program that lets the user enter a charge account number. The program should
determine if the number is valid by checking for it in the following list:
5658845
4520125
7895122
8777541
8451277
1302850
8080152
4562555
5552012
5050552
7825877
7881200
1250255
1005231
6545231
3852085
7576651
4581002
Initialize a one-dimensional array with these values. Then use a simple linear search to
locate the number entered by the user. If the user enters a number that is in the array, the
program should display a message saying the number is valid. If the user enters a number
not in the array, the program should display a message indicating it is invalid.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage