Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions Your band is playing a gig and has come up with a list of songs, which you have stored in a file called SetList.txt.

Instructions

Your band is playing a gig and has come up with a list of songs, which you have stored in a file called SetList.txt. The set list may contain up to 25 songs.

Write a C++ program that does the following:

  • Readthefileintoanarray.

  • Pass the array in a function that will sort the array (either selection sort or bubble sort.)

  • Request from the console a song to search for.

  • Write a function that will perform a binary search on the array.

  • Display that the song is on the list or not on the list depending on if you found it.

  • Continue processing songs until END is typed in.

  • Pleaserefertothetextbookforthesorting/searchingalgorithmsandsamplecode.

1

Example Input and Output

The contents of this file should look like this:

Green Onions Hold On, Im ComingNight Train Respect Ninety-Nine and a Half The Thrill Is Gone Soul Man

The display should look like this:

Reading SetList.txt file into array Sorting array Sorting done

Please enter a song or END to terminate: Respect Respect is on the set list Please enter a song or END to terminate: Knock on Wood Knock on Wood is NOT on the set list Please enter a song or END to terminate: END Program ends

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

Students also viewed these Databases questions