Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please make sure write function heading as well with well explained as guided here. Thank you You will write 3 new methods in the ArrayBag

image text in transcribedplease make sure write function heading as well with well explained as guided here. Thank you

You will write 3 new methods in the ArrayBag class: 1. bubbleSort - a method to sort the array in ascending order using the bubble sort 2. binarySearchlterative - a repetitive version of the binary search both of the search methods should be identical other than the method name.) Load your bag with some initial values, but do not fill it completely. Your client code should give the user the option to: 1. display the contents of the bag using the class method "toVector" 2. add values to the bag 3. remove values from the bag 4. sort the bag 5. search for a value using their choice of either the iterative search or the recursive search - both need to be tested Allow the user to keep doing these things until they are done. programatically that the array has not been sorted. You decide what the user interface will be. Make it clear and easy to use. It can be very basic; nothing fancy. A menu driven program works well. Each value in your array should be unique - no value will appear in the array multiple times. who is in their third semester of writing software. You will submit the following: All of program source and header files compressed into a zip file (.zip). Name your zip file "lab1_Firstname_Lastname". You decide what to name the other files. Do not include .exe files. Lab Grade Points Labs will be graded on the following: Comments Including: - Program description (comment block at top of program) - Function descriptions for every function other than main() (see function heading below) - Comments at major algorithm steps (at a minimum) Followed directions Correct output Structured program design Meaningful identifier names Function heading should look similar to this: l Function: functionName I Inputs: parameters passed and what they represent / Outputs: value(s) returned via return statemen or l on the parameter list I Purpose: This function blah blah blah..... describing what l the function does NOTE - The "NEVER" list of rules: - You will NEVER use break, exit, return, pass, continue or anything to leave a loop (or iteration), function, or other construct prematurely, unless it is part of the structure as in a case statement. - You will NEVER have a function call itself, unless it is intentional recursion. - You will NEVER use global variables. However, you may use global constants if it is appropriate and they are used properly. - You will have only one return statement in a function. (Exception - Multiple return statements may be necessary in a recursive function.)

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

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

What external methods of recruitment are available?

Answered: 1 week ago