the object of the project was to create a program that inputs multiple lines of integers and outputs them in an HTML table. The negative numbers should be red. The numbers should be printed 3 in a row, one number per column. the fourth column should contain the sum of the numbers in the row (agian if the sum is negative it should be outputed in red). Input should stop when zero is entered, but zero shouldn't be printed if there are any more cells left in the table they should be filled in with empty cells. I have tested the program without the HTML tags and it works pretty good
So here is my question I am having trouble linking the program(created in ssh in .cpp format) to a input file and when I do how can I take it from there to my computer to view it in a web browser. Since everything is saved on a server at my school.
Second question, I am new with html so this is my code if you can see any errors let me know.
thanks
#include <iostream>
using namespace std;
int main() {
int 1;
int InputCount=0;
int RowSize=4;
int ColumId = 0;
int sum = 0;
do
{
<table>
cin >> input;
if (input == 0)
break;
if (input != 0);
if (InputCount <= RowSize);
if (InputCount == 0);
ColumId =(InputCount % RowSize);
cout << <tr><td>"C1"</td> << <td>"C2" <<</td><td>"C3" << </td><td>"Sum"</td></tr>;
if (input < 0);
break;
cout<< <tr><td><font color=red>input </font></td>;
cout << <tr><td>input </td>;
InputCount ++;
sum += input;
cin >> input;
if (input==0)
break;
if (InputCount == 1);
ColumId =(InputCount % RowSize);
if (input < 0);
break;
cout<< <td><font color=red>input </font></td>;
cout << <td>input</td>;
InputCount ++;
sum += input;
cin >> input;
if (input==0)
break;
if (InputCount == 2);
ColumId =(InputCount % RowSize);
if (input < 0);
break;
cout<< <td><font color=red>input </font></td>;
cout << <td>input<td> ;
InputCount ++;
sum += input;
if (InputCount == 3)
if (sum < 0);
break;
cout<< <td><font color=red>input </font></td>;
cout << <td>sum</td></tr>;
InputCount = 0;
sum = 0;
}while(true);
while (input==0)
{
if (InputCount < RowSize)
if (InputCount == 0);
ColumId =(InputCount % RowSize);
cout << <td>" " </td>;
InputCount ++;
if (InputCount == 1);
ColumId =(InputCount % RowSize);
cout << <td>" " </td>;
InputCount ++;
if (InputCount == 2);
ColumId =(InputCount % RowSize);
cout << <td>" " </td>;
InputCount ++;
if (InputCount == 3)
if (sum < 0);
break;
cout<< <td><font color=red>input </font></td>;
cout << <td>sum</td></tr>;
break;
}
cout << endl;
</table>
}
So here is my question I am having trouble linking the program(created in ssh in .cpp format) to a input file and when I do how can I take it from there to my computer to view it in a web browser. Since everything is saved on a server at my school.
Second question, I am new with html so this is my code if you can see any errors let me know.
thanks
#include <iostream>
using namespace std;
int main() {
int 1;
int InputCount=0;
int RowSize=4;
int ColumId = 0;
int sum = 0;
do
{
<table>
cin >> input;
if (input == 0)
break;
if (input != 0);
if (InputCount <= RowSize);
if (InputCount == 0);
ColumId =(InputCount % RowSize);
cout << <tr><td>"C1"</td> << <td>"C2" <<</td><td>"C3" << </td><td>"Sum"</td></tr>;
if (input < 0);
break;
cout<< <tr><td><font color=red>input </font></td>;
cout << <tr><td>input </td>;
InputCount ++;
sum += input;
cin >> input;
if (input==0)
break;
if (InputCount == 1);
ColumId =(InputCount % RowSize);
if (input < 0);
break;
cout<< <td><font color=red>input </font></td>;
cout << <td>input</td>;
InputCount ++;
sum += input;
cin >> input;
if (input==0)
break;
if (InputCount == 2);
ColumId =(InputCount % RowSize);
if (input < 0);
break;
cout<< <td><font color=red>input </font></td>;
cout << <td>input<td> ;
InputCount ++;
sum += input;
if (InputCount == 3)
if (sum < 0);
break;
cout<< <td><font color=red>input </font></td>;
cout << <td>sum</td></tr>;
InputCount = 0;
sum = 0;
}while(true);
while (input==0)
{
if (InputCount < RowSize)
if (InputCount == 0);
ColumId =(InputCount % RowSize);
cout << <td>" " </td>;
InputCount ++;
if (InputCount == 1);
ColumId =(InputCount % RowSize);
cout << <td>" " </td>;
InputCount ++;
if (InputCount == 2);
ColumId =(InputCount % RowSize);
cout << <td>" " </td>;
InputCount ++;
if (InputCount == 3)
if (sum < 0);
break;
cout<< <td><font color=red>input </font></td>;
cout << <td>sum</td></tr>;
break;
}
cout << endl;
</table>
}
Comment