Question: In c++ Write a program that generates a web page that contains a list of 100 random RGB color values. The program should write something

In c++

Write a program that generates a web page that contains a list of 100 random RGB color values. The program should write something like the following into cout.

Assignment 4 Exercise 4

  1. 324AF3
  2. 6A3125
  3. ... 98 additional list items here ...

Organize your code using functions.

The following shows how to save the output of your program to a file named colors.html. After doing this, open the file in a web browser to see the result.

./a.out > colors.html

this is a code that generates 100 color values randomly not sure how to combine

#include #include #include using namespace std;

int main() { //seeds time to default srand(time(0)); // create array char symbols[16]= {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; //double for loop for (int i = 0; i < 100; i++) { string color = ""; int index; for (int j = 0; j<6; j++) { index = rand() % 16; color += symbols[index]; } cout << color << endl; } return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!