Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ You are trying to implement a RotatableArray class, whose main feature is a rotate function. This function takes a positive or negative integer and

C++

You are trying to implement a RotatableArray class, whose main feature is a rotate function. This function takes a positive or negative integer and rotates all of the elements of the array according to its input (rotating right for positive inputs and left for negative inputs). For example, if the array contained [1, 2, 3, 4, 5, 6, 7, 8, 9] and we called rotate(3), the array should contain [7, 8, 9, 1, 2, 3, 4, 5, 6]. Note that all elements have shifted to the right 3 positions, with the elements that shift "off the edge" of the array "rotating" back around to the other side.

Describe at least 2 interesting black-box test cases for RotatableArray::rotate. For each test case, indicate:

a) the contents of the array before rotating,

b) the input parameter to the rotate function,

c) the expected contents of the array after rotating, and

d) what you are trying to test with this test case.

You should not use the example above as one of your test cases.

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

App Inventor

Authors: David Wolber, Hal Abelson

1st Edition

1449397484, 9781449397487

More Books

Students also viewed these Programming questions

Question

What is DNS?

Answered: 1 week ago

Question

What is the difference between a name server and a resolver in DNS?

Answered: 1 week ago