I'm new to C++ so prepare yourself for something simple that I've overlooked. I'm doing a homework assignment and I have to create a table of windchills. So basically, the temperature and wind speed have to start at 5 and end at 40 in increments of 7. It sounds complicated so I'll just show you.
float windSpeed, temp;
cout<<"\t\n";
for(temp = 5; temp <= 40; temp = temp + 7){
cout << "\t" << temp;}
cout<<"\n\n\n";
for(windSpeed = 5; windSpeed <= 40; windSpeed = windSpeed + 7){
cout << "\n" << setw(5) << windSpeed << setw(5) << endl;}
This is what I have so far. And it yields this output:
https://drive.google.com/file/d/0ByPjF_TtxVWUSVZWOWJHVDJBS28/view?usp=sharing
(I don't have the rep necessary to post an image directly. First post btw.)
So basically, now I have to fill this chart thing that I've made with data. And I'm not sure what the best way to go about doing that is. Because I'm in the command prompt, if I do a separate cout function, It'll just basically start the whole thing over. I'm sure it would take some kind of recursion command. I should probably mention that the (5,5) spot should be zero, and the (40,40) spot should be 25. It goes in increments of 5.