如何在Android中生成两个数字并添加它们 [英] How Do I Generate Two Numbers And Add Them In Android

查看:113
本文介绍了如何在Android中生成两个数字并添加它们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我需要帮助生成两个数字,并显示四个可能的回答,其中正确的一个,以便用户可以从四个可能的回答中选择正确答案。

hello guys i need help on generating two numbers and displaying four possible answeres with the correct one among the so that the user can choose the correct answer from the four possible answeres.

推荐答案

您必须生成4个唯一的随机数作为选项。参考: how-to-generate-unique-random-numbers [ ^ ]

至于正确答案的选择,您可以让程序根据arraylist中4个选项的索引号随机选择它们。

当一个用户做出选择时,他选择的选项将与程序中的正确答案进行比较。
You will have to generate 4 unique random numbers as options. refer: how-to-generate-unique-random-numbers[^]
As for the choice of correct answer, you can let the program choose them randomly based on the index number of the 4 options in the arraylist.
When a use makes a choice, his chosen option will be compared with the right answer in the program.


谢谢Peter Leow



但是对于android来说真的是新手吗?你介意帮我逻辑......
Thanks Peter Leow

but am really new to android do u mind helping me with the logic...


这篇关于如何在Android中生成两个数字并添加它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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