Modify the following Program. Convert the following program as per comments
// program colors
...
Computers and Technology, 08.07.2020 04:01 redthangracing
Modify the following Program. Convert the following program as per comments
// program colors
// -> Convert class into .h header file and .ccp implemenation file.
// Keep int main() funciton same...
#include
using namespace std;
#include
/* srand example */
#include
#include /* NULL */
#include /* srand, rand */
class colorPicker {
private:
string colorArray[7];
public:
colorPicker() {
// Defalut Consructor assign values to array
colorArray[0] ="Red";
colorArray[1] ="Green";
colorArray[2] ="Purple";
colorArray[3] ="Yellow";
colorArray[4] ="Orange";
colorArray[5] ="Indigo";
colorArray[6] ="Pink";
}
void printAllColors() {
// use for loop to print out all colors
for (int i = 0 ;i < 7; i++)
{ cout << colorArray[i] << endl;}
}
string randomColor() {
srand((unsigned)time(0));
// pick a random number between 1 and 7
int i =0;
i = rand()%7;
return colorArray[i];
}
};
int main()
{
colorPicker P;
//
P. printAllColors();
cout << "Random Color: " << P. randomColor();
system("pause");
return 0;
}
Answers: 2
Computers and Technology, 22.06.2019 21:30
How do you take a green screen out of the video while editing?
Answers: 2
Computers and Technology, 23.06.2019 20:30
Column a of irmaโs spreadsheet contains titles for each row, but her document is too big and will be printed three pages across. she wants to be sure that every page will be understood. what can irma do to with this problem?
Answers: 3
Computers and Technology, 23.06.2019 21:40
language consists of basic components, and they are called a. 3; mental images, concepts, and speech b. 2; language acquisition and linguistic relativity c. 3; heuristics, algorithms, and analogies d. 4; phonemes, morphemes, syntax, and semantics e. 2; words and grammar
Answers: 3
Biology, 27.08.2019 17:30
History, 27.08.2019 17:30
Social Studies, 27.08.2019 17:30
Mathematics, 27.08.2019 17:30
Chemistry, 27.08.2019 17:30
Mathematics, 27.08.2019 17:30
Geography, 27.08.2019 17:30