Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using c++. The file named charge_accounts.txt contains a companys list of valid charge account numbers. Each account number is a seven-digit number, such as 5658845

Using c++.

The file named charge_accounts.txt contains a companys list of valid charge account numbers. Each account number is a seven-digit number, such as 5658845.

Write a program that reads the contents of the file into an array. The program should then ask the user to enter a charge account number. The program will determine whether the number entered by the user is valid by searching for it in the array of valid account numbers. If the number is in the array, the program should display a message indicating the number is valid. If the number is not in the array, the program should display a message indicating the number is invalid.

Write your program in such a way as to allow the user to repeatedly enter charge account numbers for validation until the user enters a Sentinel value, such as a negative number.

using c++ only.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions