Using C++ files,Your next program is to validate a six-digit PIN for a local bakery's customers (it tracks their purchases to determine when free items are to be awarded).Your first requirement is to...

2 answer below »
Using C++ files,

Your next program is to validate a six-digit PIN for a local bakery's customers (it tracks their purchases to determine when free items are to be awarded).






Your first requirement is to populate a single-dimensional array with the following numbers (15 of them, populated in this order):


102345 597125 895122 765541 103277

198152 543155 552012 645552 825877

305231 522233 987085 566561 881300


Once you have the array populated with these values (in the order they are listed), the vet wants you to code the rest of the program to ask the user for a PIN number and then, using a
BINARY
searchfunction, determine if the PIN number is valid (it will be valid if it is in the list of values above). Before you can execute a binary search function, you MUST create another function that will sort the values in the array in either ascending or descending order (See paragraph below, I recommend ascending). Then return from the binary search function whether the PIN number is valid or not. If the PIN is valid, the program will display a "PIN number is valid" message. If it is not valid, the program will display an "Invalid PIN numberentered, contact authorities" message. The program will then ask the user if they want to validate another PIN number, and if they answer Y, the process will continue. If the user chooses not to continue, the program will display a "Thank you for visiting our Clinic's web site" message and then terminate.


In order to execute a binary search, recall that the array must FIRST be sorted in ascending (or descending) order BEFORE you attempt to conduct the binary search. Pass the unsorted array into a function that completes a
bubble
sort to get the array in the correct order. As part of your program development, you might want to then display the contents of the array to verify that your sort is working BEFORE you attempt the search portion of the program. You can then remove the display of the array contents and move on to the binary searching portion.




Answered Same DayNov 08, 2022

Answer To: Using C++ files,Your next program is to validate a six-digit PIN for a local bakery's customers (it...

Vibhav answered on Nov 09 2022
43 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here