Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started