I'm having trouble doing my web developing homework because I don't know enough java. It seems very easy, but it is a very difficult task for me.I want to explain it. My task about the code will generate 5 random numbers, then display them on the page as a list. Each number generated will be between 1 and 100 and will have a variable name. After this, the code will generate a table with 4 columns and 5 rows. Variable names of the generated numbers will be written in the first two columns randomly. In the third column, a random mathematical operation will appear. In the fourth column the result will be displayed. After this, you will create a mathematical function by yourself and give the results to that function as parameters the code will calculate the result of the function and mod 10 will be applied to the result. The final result will be shown to the user. Below that, there will be 10 links which are labeled from 0 to 9. If the user clicks on the correct link, then the page will navigate to your own personal page, otherwise user will be redirected to a page that displays the resultis wrong.taskimage
I've been working on it for 4 hours, but I can only write those codes. Of course it doesn't work.
<h2>Random Table</h2>
<TABLE>
<% for(int row=1; row <= 5; row++) { %>
<TR>
<%
List<Integer> sayilar1 = new ArrayList<Integer>();
int random = (int)(Math.random() * 50);
sayilar1.add(random);
%>
<TD> (<%=random%>)
</TD>
<% } %>
<% for(int row2=1; row2 <= 5; row2++) { %>
<%
List<Integer> sayilar2 = new ArrayList<Integer>();
int random2 = (int)(Math.random() * 50);
sayilar2.add(random2);
%>
<TD>
<%=random2%>
</TD>
<% } %>
</TR>
</TABLE>
Aucun commentaire:
Enregistrer un commentaire