Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please complete this program in C++. nsu.blackboard.com our Career Oppo... Apply Students NSU zipcar Migos Students NSU Students NSU https:/su.b... a Study Laboratory 11 Fall

Please complete this program in C++.

image text in transcribedimage text in transcribed

nsu.blackboard.com our Career Oppo... Apply Students NSU zipcar Migos Students NSU Students NSU https:/su.b... a Study Laboratory 11 Fall 2018 Sort and Binary Search List Submit to Blackboard one C++ file: Lab11RadioPrizeSort _firstinitiallastName.cpp. The code in the file must include your name, the course, the file name (the full path name) and the program description in comments. Example // File Name: C:temp LabllRadioPrizeSort firstInitialLastName.cpp Author: your name Course: CSC-260L-03 // Program Description: The purpose of this program is giving you the hand on experience with the sorting and binary searching. Design a program that simulates a contest for a radio station that awards a $10,000 prize to the first caller who correctly guesses a number in a list of randomly generated numbers. A caller can make one guess per call. The contest is held until a number has been matched or the user enters a value of-1. The code used to generate a random list between 1 and 500 (inclusively) is in CreateList.cpp. The list generated from running Createlist.cpp is PrizeList.txt The program will read the data file and store them into an array of integers, called prizeNumbers. You need sort all elements in the array before search for an element. The program will then perform a binary search which should be more efficient with large array Selection sort is one of the basic algorithms for sorting data, its simplicity proves useful for sorting small amounts of data. Selection sort works by first starting at the beginning array (index 0) and traverses the entire array comparing each value with the current index, if it is smaller than the current index than that index is saved. Once the loop has traversed all the data and if a smaller value than the current index was found a swap is made between the current index with the index where the smaller value was found. The current index is then incremented, now to index 1, the algorithm repeats. Of course, a visual representation is usually more useful. Take an unsorted array that holds five integers. 2 3 There are three main variables in selection sort, the variable 'i keeps the index that may be potentially switched if a smaller value is found. The variable '' traverses through the array searching for a value smaller than 'min'. The variable 'min' is the current smallest value in the array, it's updated only if a value smaller than it is found. nsu.blackboard.com our Career Oppo... Apply Students NSU zipcar Migos Students NSU Students NSU https:/su.b... a Study Laboratory 11 Fall 2018 Sort and Binary Search List Submit to Blackboard one C++ file: Lab11RadioPrizeSort _firstinitiallastName.cpp. The code in the file must include your name, the course, the file name (the full path name) and the program description in comments. Example // File Name: C:temp LabllRadioPrizeSort firstInitialLastName.cpp Author: your name Course: CSC-260L-03 // Program Description: The purpose of this program is giving you the hand on experience with the sorting and binary searching. Design a program that simulates a contest for a radio station that awards a $10,000 prize to the first caller who correctly guesses a number in a list of randomly generated numbers. A caller can make one guess per call. The contest is held until a number has been matched or the user enters a value of-1. The code used to generate a random list between 1 and 500 (inclusively) is in CreateList.cpp. The list generated from running Createlist.cpp is PrizeList.txt The program will read the data file and store them into an array of integers, called prizeNumbers. You need sort all elements in the array before search for an element. The program will then perform a binary search which should be more efficient with large array Selection sort is one of the basic algorithms for sorting data, its simplicity proves useful for sorting small amounts of data. Selection sort works by first starting at the beginning array (index 0) and traverses the entire array comparing each value with the current index, if it is smaller than the current index than that index is saved. Once the loop has traversed all the data and if a smaller value than the current index was found a swap is made between the current index with the index where the smaller value was found. The current index is then incremented, now to index 1, the algorithm repeats. Of course, a visual representation is usually more useful. Take an unsorted array that holds five integers. 2 3 There are three main variables in selection sort, the variable 'i keeps the index that may be potentially switched if a smaller value is found. The variable '' traverses through the array searching for a value smaller than 'min'. The variable 'min' is the current smallest value in the array, it's updated only if a value smaller than it is found

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

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

Explain how self-monitoring is related to consumer behavior.

Answered: 1 week ago

Question

2. Place a value on the outcomes.

Answered: 1 week ago