5. Charge Accoun If you have downloac a file named charge_a pany's valid charge acc as 5658845. Write a program that ask the user to enter a the number is valid by s should display a messag program should display

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question
100%
5. Charge Account Validation
If you have downloaded the source code from the Computer Science Portal you will find
a file named charge_accounts.txt in the Chapter 07 folder. This file has a list of a com-
pany's valid charge account numbers. Each account number is a seven-digit number, such
as 5658845.
Programming Exercises 403
program
Write a program that reads the contents of the file into a list. The program should then
ask the user to enter a charge account number. The program should determine whether
the number is valid by searching for it in the list. If the number is in the list, the
should display a message indicating the number is valid. If the number is not in the list, the
program should display a message indicating the number is invalid.
(You can access the
Transcribed Image Text:5. Charge Account Validation If you have downloaded the source code from the Computer Science Portal you will find a file named charge_accounts.txt in the Chapter 07 folder. This file has a list of a com- pany's valid charge account numbers. Each account number is a seven-digit number, such as 5658845. Programming Exercises 403 program Write a program that reads the contents of the file into a list. The program should then ask the user to enter a charge account number. The program should determine whether the number is valid by searching for it in the list. If the number is in the list, the should display a message indicating the number is valid. If the number is not in the list, the program should display a message indicating the number is invalid. (You can access the
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning