A text file has been included in the project. Instead of initializing the array (like the problem in the text says), you should read this information from the text file into your array. The account numbers in the file are shorter than the ones in the problem, but your program should be able to handle this slight variation. You should the following functions: 1. A function reads the data from the file and fills the array. 2. A function that gets an account number from the user and returns it as an integer. 3. A function that performs the linear search in the array for the number. It should return the position of the account number or "-1" if the account number is not in the array. The program should display a message indicating the account number is valid or that it is not valid. • Adda sort function that uses the bubble sort to sort the account numbers. • Adda display function that displays the array. Show the array before it's sorted and after it's sorted. • Adda binary search function that will search the sorted list of account numbers. Leave the linear search function in place but comment it out and write a completely new binary search function.
A text file has been included in the project. Instead of initializing the array (like the problem in the text says), you should read this information from the text file into your array. The account numbers in the file are shorter than the ones in the problem, but your program should be able to handle this slight variation. You should the following functions: 1. A function reads the data from the file and fills the array. 2. A function that gets an account number from the user and returns it as an integer. 3. A function that performs the linear search in the array for the number. It should return the position of the account number or "-1" if the account number is not in the array. The program should display a message indicating the account number is valid or that it is not valid. • Adda sort function that uses the bubble sort to sort the account numbers. • Adda display function that displays the array. Show the array before it's sorted and after it's sorted. • Adda binary search function that will search the sorted list of account numbers. Leave the linear search function in place but comment it out and write a completely new binary search function.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
See attached images
C++

Transcribed Image Text:A text file has been included in the project. Instead of initializing the array (like the problem in the text
says), you should read this information from the text file into your array. The account numbers in the
file are shorter than the ones in the problem, but your program should be able to handle this slight
variation.
You should the following functions:
1. A function reads the data from the file and fills the array.
2. A function that gets an account number from the user and returns it as an integer.
3. A function that performs the linear search in the array forthe number. It should return the
position of the account number or "-1" if the account number is not in the array.
The program should display a message indicating the account number is valid or that it is not valid.
• Add a sort function that uses the bubble sort to sort the account numbers.
• Add a display function that displays the array. Show the array before it's sorted and after it's
sorted.
• Add a binary search function that will search the sorted list of account numbers. Leave the
linear search function in place but comment it out and write a completely new binary search
function.
1
5658
2
4500
3
7895
4
5684
1298
5783
7
4195
8
2753
9.
6948
10
5866
11
8572
12
9124
13
3578
14
6842
15
2486
16
5713
17
3584
18
0025

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 1250255
1005231 6545231 3852085 7576651 7881200 4581002
The list of numbers above should be initialized in a single-dimensional
array. A simple linear search should be used 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 that the number is valid. If
the user enters a number that is not in the array, the program should
display a message indicating that the number is invalid.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 4 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY