Please enable JavaScript.
Coggle requires JavaScript to display documents.
n (collect, study) - Coggle Diagram
n
collect
.
問題2.計算統計
編寫一個Java程序Statistics.java來提示用戶輸入一些正實數並存儲
提示
輸入一些正實數
它們放在雙精度類型數組x [10]中。 用戶最多可以輸入10個數字。 該程序
它們放在雙精度類型數組x [10]中
當用戶輸入第10個數字或輸入一個負值(例如, -1。
然後,程序開始計算以下統計信息。
1.總和= ∑𝑥𝑖
𝑛
𝑖= 1
2.均值,𝑥̅=
𝑆𝑢𝑚
𝑛
3.最大值
4.最低
5.標準偏差,𝜎 =√
∑
𝑛(𝑥𝑖−𝑥̅)2
𝑖= 1
𝑛−1
(僅適用於n> 1)
使用以下五個數字測試您的程序,分別為1.23、2.05、4.0、0.01、0.12。 他們的總和= 7.41
平均值= 1.48,最大值= 4.0,最小值= 0.01,標準偏差= 1.64。
https://translate.google.com/?hl=zh-TW&sl=auto&tl=zh-TW&text=Problem%202.%20Calculate%20Statistics%0AWrite%20a%20Java%20program%2C%20Statistics.java%2C%20to%20prompt%20a%20user%20to%20input%20some%20positive%20real%20numbers%20and%20store%0Athem%20in%20a%20double%20type%20array%2C%20x%5B10%5D.%20The%20user%20can%20enter%20no%20more%20than%2010%20numbers.%20The%20program%0Ashould%20stop%20prompting%20input%20when%20the%20user%20entered%20the%2010th%20number%20or%20input%20a%20negative%20value%2C%20e.g.%20-1.%0AThen%2C%20the%20program%20starts%20to%20calculate%20the%20following%20statistics.%0A1.%20Sum%20%3D%20%E2%88%91%20%F0%9D%91%A5%F0%9D%91%96%0A%F0%9D%91%9B%0A%F0%9D%91%96%3D1%0A2.%20Mean%2C%20%F0%9D%91%A5%CC%85%3D%0A%F0%9D%91%86%F0%9D%91%A2%F0%9D%91%9A%0A%F0%9D%91%9B%0A3.%20Maximum%0A4.%20Minimum%0A5.%20Standard%20Deviation%2C%20%F0%9D%9C%8E%20%3D%20%E2%88%9A%0A%E2%88%91%0A%F0%9D%91%9B%20(%F0%9D%91%A5%F0%9D%91%96%E2%88%92%F0%9D%91%A5%CC%85)2%0A%F0%9D%91%96%3D1%0A%F0%9D%91%9B%E2%88%921%0A(for%20n%3E1%20only)%0ATest%20your%20program%20with%20the%20following%20five%20numbers%2C%201.23%2C%202.05%2C%204.0%2C%200.01%2C%200.12.%20Their%20sum%3D7.41%2C%0Amean%3D1.48%2C%20maximum%3D4.0%2C%20minimum%3D0.01%2C%20and%20standard%20deviation%3D1.64.&op=translate
.
lev
just
enter some number
show me some number
after process
a no?
c th x wa?
ma fo?
hap?
sh b emo
mis
i x li u
takr
but x wan
i jus enjo les
x enj hq?
y?
wmhr?
pp d hap
y?
m
possible
x m
hap
note
next lesson
i can find
before
lesson
in moodle
task1
q3
lecture note
p17
lea n
bef le?
i ju wa
en fas
g h
re
ous
x hap
x ha
he
lau?
y
x su
the
x wa b p w m
rea
1 more item...
wmhr
i tak p
ho can i fel gr
a sch?
th p ro
le p
go li
fut
aft 4pn
ok
y
de
fd
y?
i mat
x this ..
p ca m ?
se m m ar?
sca.
ho?
pas...
jus stu 1 ..
i think 0
but ....
interest find ...
sh str?
i xl i
i i a u
h p
th h pofl
i x lik
lo 3,3
.
ho?
x mo pa.
how?
y i x st
sse
?
x kn ta
x d lo
hap
impo
..
k y fal?
usf?
ms tea
as?
q6
if else
sug
if x us
l mar
expec
syntax error
less many marks
qu
wmhr?
wa
as q
aft
wan
case by case
ask after
ok
lon tim pero
fol q requ
wmhr
x
do
x ma
x ha
fo
ha
doub
q1
i kn
y
la01
i didi it before
ho de
p a m m m
i x li
i ju sa
mm onl
int /
mean
cut the xx.(xxxxx)
pr2
ho?
white table
x li
p tak m p?
i x l
h cxd?
sa
g
xw
s
v
enter
1.1 ,2.0 ,3.4
e.g -1
advance
intN++
str?
mim
xlw
i ex
n++
sir said
suitable
gd
y?
because
like
if
++n?
first?
first is 1
++n;?
ok?
sir said
ok
n is 0 before
q
sir
want we look at him
i un c?
x
q re
?
x
h i k
?
c p
1 more item...
df1
hap
i x w
e;
i w m
i sc
li si
i ha
x nee han i today?
rea
si sugge
pa tim on stu
ok
pas
q1and 2 onl
q1
easy
q2
q3
method
mock
Write a method printNumber(int n)
no then bye?
q4
method and think
can use other editor
java file
sir only use notepad++
else x ok ?
he x
i want
x ca
as?
q2?
prompt
1sch 1 q ?
study
??