Starting from:

$30

Data Strucres lab 06-Review of C++ Arrays Solved




How to Add the Webhook: To add the webhook:

1.   Open up your github on Github.com

2.   Go to settings.

3.   Click Webhooks.

4.   Click add webhooks.

5.   The Payload URL is:

http://csci.csuniv.edu:2234/github/build-csci-315-spring-2019.php Select json for content type.



6.   Click add webhook.

Remember, after the first push, please wait 5-10 minutes for the auto-grader to get your repository. Then subsequent pushes should receive a grade.

Instructions: This lab is to review arrays in C++. While Java arrays have similarities with C++ arrays, there are differences. First, Java arrays are objects, while C++ arrays are just sequential list of elements. The key usage difference is that C++ does not store any information about the array (like length.) Therefore any extraneous information must be stored separately.

Note:Your header file should be in src/arrays.hpp, your C++ code should be in src/arrays.cpp

I do not need a main file.

Implement the following functions:

/* Returns the number of elements in the array that are less than 0. */ int countNegatives(const int array[], int size);

/* Find the smallest odd value in the array.

*   Returns -1 if there is no odd value in the array.

*/ int findMinOdd(const int array[], int size);

/* Returns the index in the array where value is found.

*   Return -1 if the value is not present in the array.

*/ int search(const int array[], int size, int value);

/* Removes an item at position index by shifting later elements left. * Returns true iff 0 <= index < size.

*/ bool remove(int array[], int size, int index);
1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

Testing:

Please write some test cases to ensure you code is working correctly. You may utilize CXXtestgen or write you own manual test cases in a main file.

How to turn in:

Turn in via GitHub. Ensure the file(s) are in your directory and then:

•    $ git add <files

•    $ git commit

•    $ git push


More products