Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

170 Lab 7-Searching & Sorting Arrays (4/4/18) Part 1- Charge Account Validation (We will work together to solve this problem) Write a program that lets

image text in transcribed
170 Lab 7-Searching & Sorting Arrays (4/4/18) Part 1- Charge Account Validation (We will work together to solve this problem) Write a program that lets the user enter a credit card account number. The program should determine if the number is valid by checking for it in the following list 5658845 8080152 1005231 6545231 3852085 7576651 7881200 4581002 4520125 4562555 7895122 5552012 8777541 5050552 8451277 7825877 1302850 1250255 The list of numbers above is originally stored in an input file (named accounts.txt) and should then 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. Part 2 Charke Account Validation Modification due Monday on the / (You and a partner may work on this problem) Modify the program that we wrote in Part 1 so it performs a binary search to locate valid account numbers. Use the selection, bubble, or insertion sort algorithms to sort the array before the binary search is performed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions