根据范围内的数字创建一个单词 [英] Make a word based on the number inside a range

查看:73
本文介绍了根据范围内的数字创建一个单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三个范围1-10,11-15和16-20现在我有一个可变数字字段,它创建一个介于1到20之间的数字。我需要根据数字落在其中的位置出现一个单词。三个范围,例如范围一,它会说低范围两个med范围三个高



我尝试过:



我似乎无法理解如何检查并让它读取范围然后创建数字,我是非常非常新的Java或任何编码的事情

I have three ranges 1-10, 11-15, and 16-20 now I have a variable number field that creates a number between 1 - 20. I need a word to appear based on where the number falls inside of the three ranges, example in range one it would say low range two med range three high

What I have tried:

Nothing I can't seem to understand how to check and have it read ranges and then create numbers, I'm extremely very new at Java or any coding for that matter

推荐答案

既然你是非常非常新的Java,那么你应该经常这个 Java™教程 [ ^ ]。

完成所有课程和示例,不跳过。您将能够解决您的问题(即分配)。特别注意比较运算符(<,>, - ,!=)和决策构造(if else if)。如果你需要执行输入/输出操作,请问Google,WWW中有很多例子。
Since you are "Extremely very new to Java", then you should frequent this The Java™ Tutorials[^].
Go through all the lessons and examples, no skipping. You will be able to solve your question (aka assignment). Pay particular attention to comparison operators (<, >, --, !=) and decision making construct (if else if). If you need to perform input/output operation, ask Google, there are plenty of examples out in the WWW.


这篇关于根据范围内的数字创建一个单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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