iT邦幫忙

0

求救,走了幾堂課,甚麼都沒學,java ...plz

Write a Java program that will ask the user to enter a floating-point number, read the user's
response, and tell the user whether the number's square root is between 1 and 50 inclusive. You can
assume the user will always provide valid input(s) so you do not have to deal with input validation.
Sample Output:
Type a number: 123.4
The square root of 123.4 is between 1 and 50.
Type a number: 4567.8
The square root of 4567.8 is out of 1 and 50.

看更多先前的討論...收起先前的討論...
編寫一個Java程序,要求用戶輸入一個浮點數,讀取用戶的
回應,並告訴用戶該數字的平方根是否介於1和50之間。
您可以假設用戶將始終提供有效的輸入,因此您不必處理輸入驗證。
示例輸出:
鍵入數字:123.4
123.4 的平方根介於1和50之間。
鍵入數字:4567.8
4567.8 的平方根超出1和50。

幫樓主翻譯,基本上會基本語法這個題目不難,以前上java 這種題目很多
每周都有類似的作業要回家寫,基本上有上過課,有聽見老師說啥,三觀有放在 java 上面,應該不難
weiclin iT邦高手 4 級 ‧ 2018-10-11 17:53:55 檢舉
明年再學一次就好了吧
基礎打好比較重要!明年再學一次就好了!
黃彥儒 iT邦高手 1 級 ‧ 2018-10-11 19:44:26 檢舉
1<INPUT<2500
bluegrass iT邦高手 1 級 ‧ 2018-10-12 11:52:51 檢舉
明年再走幾堂課試試就會了
youarefat iT邦新手 5 級 ‧ 2018-10-12 14:14:22 檢舉
對啊 就照上面的 確認是不是(1,2500)就好了啊
棉花 iT邦新手 4 級 ‧ 2018-10-12 16:23:52 檢舉
好課值得一修再修
fuzzylee1688 iT邦研究生 3 級 ‧ 2018-10-12 16:46:47 檢舉
讚哦.. 可別拿同學寫好的, 直接修改 變數 名字就交差了..
1<INPUT<2500
這想法精闢(跪
我腦袋很直觀的思考要呼叫個數學函式真的去算出平方根==
換個思路,檢查1<INPUT<2500比起算出開根號更好作條件判斷
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答