Study topic for this question
ဤမေးခွန်းအတွက် လေ့လာရန် ခေါင်းစဉ်
More questions on the same topic
တူညီသောခေါင်းစဉ်မှ မေးခွန်းများ
When sorting 4 elements in ascending order by repeating the procedure below, how many times is the series of steps (1)-(3) executed until sorting is complete? Data: [27, 42, 33, 12] (1) Find the maximum in the sort target and swap it with the last element. (2) Remove the last element from the sort target. (3) If one or more elements remain, execute (1)-(3) again; otherwise, sorting is complete.
အောက်ပါ လုပ်ငန်းစဉ်ကို ထပ်ခါတလဲလဲ ဆောင်ရွက်ကာ ဒြပ်စင် ၄ ခု ပါဝင်သော ဒေတာကို ascending order ဖြင့် စီစဉ်ရာ sorting ပြီးစီးသည်အထိ (1)-(3) လုပ်ဆောင်ချက်များ မည်မျှ ကြိမ် ဆောင်ရွက်ရမည်နည်း? ဒေတာ: [27, 42, 33, 12] (1) sort target တွင် အကြီးဆုံးတန်ဖိုးကို ရှာဖွေ၍ နောက်ဆုံးဒြပ်စင်နှင့် လဲလှယ်သည်။ (2) နောက်ဆုံးဒြပ်စင်ကို sort target မှ ဖယ်ရှားသည်။ (3) sort target တွင် ဒြပ်စင် တစ်ခုနှင့်အထက် ကျန်ရှိပါက (1)-(3) ကို ထပ်ဆောင်ရွက်သည်; မကျန်ပါက sorting ပြီးစီးသည်။
Function calculateAmountOfPrize receives improvement amount and time reduction as 'improvement' and 'period', returning the prize amount. There were two improvements: 200,000 yen/3 days and 50,000 yen/14 days. What is the total prize amount? [Program] ○Integer: calculateAmountOfPrize(Integer: improvement, Integer: period) Integer: prize if (improvement < 100000) if (period < 7) prize ← 500 else prize ← 1000 endif else if (period < 7) prize ← 2000 else prize ← 5000 endif endif return prize
calculateAmountOfPrize function သည် လုပ်ငန်း တိုးတက်မှုပမာဏ (improvement) နှင့် အချိန်တိုတောင်းမှုကာလ (period) ကို လက်ခံကာ ဆုကြေးငွေ ပြန်ပေးသည်။ တိုးတက်မှု ၂ ဦးရှိသည်: ကျပ် ၂၀၀,၀၀၀ / ၃ ရက် နှင့် ကျပ် ၅၀,၀၀၀ / ၁၄ ရက်။ ဆုကြေးငွေ ပေါင်းစုစုမျှ မည်မျှနည်း? [Program] ○Integer: calculateAmountOfPrize(Integer: improvement, Integer: period) Integer: prize if (improvement < 100000) if (period < 7) prize ← 500 else prize ← 1000 endif else if (period < 7) prize ← 2000 else prize ← 5000 endif endif return prize