Math.random解决方案并在不同位置显示数组内容java [英] Math.random solution and display array contents at different positions java

查看:83
本文介绍了Math.random解决方案并在不同位置显示数组内容java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从四个不同的文件中读取



将内容写为.html



四个文件每个有十四个单词



文件1是问题所以java对象从中读取并写入.html



现在File2 3和4有答案



和文件四有正确答案java从这些文件读取并创建单选按钮



有问题和答案作为单选按钮



解答需要从答案中读取并在不同的位置显示它们如果问题1有正确的话在单选按钮1回答然后回答两个应该在单选按钮2处回答而不是一个等等等等





问候



我尝试了什么:



java代码搜索代码refractoring arrays

Is there a way to read from four different files

write the contents as .html

Four Files Have fourteen words each

File 1 is question so java object reads from that and writes .html

Now File2 3 and 4 have answers

and file four has correct answer java reads from these files and creates radio buttons

There is question and answers as radio buttons

Solution is required to read from answers and display them at different positions so if Question 1 has correct answer at radio button 1 then answer two should have answer at radio button 2 and not one and so on and so forth


regards

What I have tried:

java code search code refractoring arrays

推荐答案

所以,你必须编写 Java 代码才能阅读 4 文本文件构建带有读取数据的测验HTML页面。

查看 Java文件和I / O [ ^ ]祝你好运!



(也就是说,这里只询问具体问题)。
So, you have to write Java code for reading 4 text files an build a quiz HTML page with the read data.
Have a look at Java Files and I/O[^] and good luck!

(That is, ask here just specific questions).


Quote:

有没有办法从四个不同的文件中读取

Is there a way to read from four different files



是的,这个是你的功课。这是你锻炼解决方案的责任,至少是部分解决方案。


Yes and this is your homework. This is your duty to workout a solution, at least a partial one.

引用:

从文件中读取很容易在不同的位置写答案不是那个具体的问题

reading from file is easy writing answer at different position is not that is the specific question



唯一看起来像问题的是有没有办法从四个不同的文件中读取,你说的是不是问题。



建议:

- 避免电报风格,写句子。

- 它是HomeWork,显示你做了什么(代码)。

- 明确说明问题是什么,问题。



在这个网站上,我们帮你修复你的代码,我们不做你的HomeWork


The only thing that look like a question is "Is there a way to read from four different files", and you say it is not the problem.

Advice:
- Avoid telegraphic style, write sentences.
- It is HomeWork, show what you have done (code).
- State clearly what is the question, the problem.

In this site, we help you fix your code, we don't do your HomeWork


在不同的位置写答案只需要你得到0到3之间的随机数。然后你可以用它来索引包含对四个单选按钮的引用的数组。因此,对于每个答案,获取随机值,如果已经设置,则跳过以获得另一个。如果是新的,则将答案文本发布到相关的单选按钮上。重复,直到完成所有设置。
Writing the answers at different positions just requires you to get a random number between 0 and 3. You can then use that to index an array that contains references to the four radio buttons. So for each answer, get the random value, if it has already been set then skip to get another. If it is new then post the answer text against the relevant radio button. Repeat until all are set.


这篇关于Math.random解决方案并在不同位置显示数组内容java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆