Question
Write a program that lets the user enter a charge accoutnnumber. THe program should determing if the number is valid bychecking for it in the following list: 5658845, 4520125, 7895122, 8777541, 8451277, 1302850 8080152, 4562555, 5552012, 5050552, 7825877, 1250255 1005231, 6545231, 3852085, 7576651, 7881200, 4581002 Initialize a one-dimensional array with these values. Then usea simple linear search to locate the number entered by the user. Ifthe user enters a number that is in the array, the program shoulddisplay a message saying the number is valid. If the user enters anumber not in the array, the program should display a messageindicating it is invalid. Write a program that lets the user enter a charge accoutnnumber. THe program should determing if the number is valid bychecking for it in the following list: 5658845, 4520125, 7895122, 8777541, 8451277, 1302850 8080152, 4562555, 5552012, 5050552, 7825877, 1250255 1005231, 6545231, 3852085, 7576651, 7881200, 4581002 Initialize a one-dimensional array with these values. Then usea simple linear search to locate the number entered by the user. Ifthe user enters a number that is in the array, the program shoulddisplay a message saying the number is valid. If the user enters anumber not in the array, the program should display a messageindicating it is invalid.
Explanation / Answer
#include using namespace std; int main() { float accounts[18]= {5658845, 4520125, 7895122, 8777541,8451277, 1302850, 8080152, 4562555,5552012, 5050552, 7825877, 1250255, 1005231, 6545231,3852085, 7576651, 7881200, 4581002}; float accountNumber=0; coutaccountNumber; cout