Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ - I need help with the table in the HTML file. I cannot figure out how to get the top left cell empty. This

C++ - I need help with the table in the HTML file. I cannot figure out how to get the top left cell empty. This is a similar example of how the table should look. I also don't know how to get the "Wind (MPH)" or Temperature labels. Please help!

image text in transcribed

#include //to use cout and cin and endl// allows using cout without std::cout

#include // to use string data type

#include //to use strlen, strcmp, strcpy

#include //for pow function,sqrt,abs

#include // for set precision, setw,

#include //for file input

#include // to use assert to disable place before #define NDEBUG

#include //for random numbers, exit function

#include //time function used for rand seed

#include // for toupper, tolower

#include

#include

#include

#include

#include

//Windchill

using namespace std;

/*

*

*/

double calcWind(double temperature, double windSpeed)

{

double wind = 0;

wind = 35.74 + (.621 * temperature) - (35.75 * pow(windSpeed, 0.16)) + (.4275 * temperature * pow(windSpeed, .16));

return wind;

}

int main(int argc, char** argv)

{

int windStart = 5, windEnd = 50;

int tempStart = 50, tempEnd = 5;

const int rows = (windEnd - windStart) / 5 + 1;

const int cols = (tempStart - tempEnd ) / 5 + 1;

double values[rows][cols];

for(int wind = windStart, r = 0; wind

{

for(int temp = tempStart, c = 0; temp >= tempEnd; temp -= 5, c++)

values[r][c] = calcWind(temp, wind);

}

//print the temperature column heading

cout

for(int temp = tempStart; temp >= tempEnd; temp -= 5)

cout

cout

cout

for(int wind = windStart, r = 0; wind

{

cout

for(int temp = tempStart, c = 0; temp >= tempEnd; temp -= 5, c++)

cout

cout

cout

ofstream outfile;

outfile.open("c:\\users\\marka\\documents\ etBeansProjects\\homework\\windChill.html"); //Open file to send data to an HTML file

outfile

Amy Allen";

outfile table, th, td { border: 1px solid black;border-collapse:collapse;background-color:lightpink;} td{width:120px;}"; //Choose color for inside the table

outfile

"; //Choose color for outside the table

outfileWind Chill ";

outfileWind Chill Chart

" ; //Display Message

outfile";

for(int temp = tempStart, c = 0; temp >= tempEnd; temp -= 5)

{

outfile

outfile "

}

for(int wind = windStart, r = 0; wind

{

outfile

""""""""""" "; //Requesting the data that is needed in the rows and columns

}

outfile ";

outfile ";

}

return 0;

}

Temperature (OF) 10 10 -15 10 25 -5 11 16-22-28 34 -40 -4-10-16-22-28-35-41-47 -13 19 26 32 39 45 51 17 11 4-2-9-15 -22-29-35-42-48-55 30 25 20 15 5 25 19 137 10 21 15 9 3 -4 10 16 15 19 13 6 0 7 3 20 25 16 9 3 4 -11 -17 -24 31 -37 44 -51 58 16 9 3411 17243137-44-51 -58 15 8 1-5 12 -19 -2633-39-46 53-60 14 7 07 14 -21-27 34 -41 4855-62 13 61-8-15 22 2936 43 50 5764 45 12 5 -2 9-16 -23 -30 -37 44 -5158 -65 12 4-3-10-17 -24-31-38-45-52-60-67 11 4 -3 -11 18 -25-32 39 46 54-6168 0 15 8 1 -5 30 35 40 50 60 10 3 4 11 19 Temperature (OF) 10 10 -15 10 25 -5 11 16-22-28 34 -40 -4-10-16-22-28-35-41-47 -13 19 26 32 39 45 51 17 11 4-2-9-15 -22-29-35-42-48-55 30 25 20 15 5 25 19 137 10 21 15 9 3 -4 10 16 15 19 13 6 0 7 3 20 25 16 9 3 4 -11 -17 -24 31 -37 44 -51 58 16 9 3411 17243137-44-51 -58 15 8 1-5 12 -19 -2633-39-46 53-60 14 7 07 14 -21-27 34 -41 4855-62 13 61-8-15 22 2936 43 50 5764 45 12 5 -2 9-16 -23 -30 -37 44 -5158 -65 12 4-3-10-17 -24-31-38-45-52-60-67 11 4 -3 -11 18 -25-32 39 46 54-6168 0 15 8 1 -5 30 35 40 50 60 10 3 4 11 19

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

Students also viewed these Databases questions

Question

LO4 Specify how to design a training program for adult learners.

Answered: 1 week ago