テクノロジ系 2025年度 問6 ★★★☆☆ Medium
At a certain company, employees get a medical allowance equal to 5% of their monthly base salary in addition to their monthly base salary. If the total of the monthly base salary and medical allowance is more than 5,000, a 20% tax is deducted from the total. In the program below, the function calculateTotalSal receives the monthly base salary as an argument and returns the monthly total salary after tax deduction. Which of the following is the correct combination of pieces of code to be inserted into [A] and [B] in the program? Here, the monthly base salary is a multiple of 100.
[Program]
O integer: calculateTotalSal(integer: monthlyBaseSal)
integer: monthlyTotalSal
monthlyTotalSal <- integer part of (monthlyBaseSal x 1.05)
if (monthlyTotalSal > [A])
monthlyTotalSal <- integer part of (monthlyTotalSal x [B])
endif
return monthlyTotalSal
မြန်မာ
ကုမ္ပဏီတစ်ခုတွင် ဝန်ထမ်းများသည် လပတ်လစာအခြေခံ၏ 5% နှုန်းဖြင့် ကျန်းမာရေးကြေးကို ထပ်ဆောင်းရရှိသည်။ လပတ်လစာအခြေခံနှင့် ကျန်းမာရေးကြေး ပေါင်းစုသည် 5,000 ကျော်လျှင် ပေါင်းစုမှ 20% အခွန်ကို နုတ်ပယ်သည်။ အောက်ပါ program တွင် calculateTotalSal function သည် လပတ်လစာအခြေခံကို argument အဖြစ်လက်ခံကာ အခွန်နုတ်ပြီးနောက် လပတ်စုစုပေါင်းလစာကို ပြန်ပေးသည်။ Program ထဲရှိ [A] နှင့် [B] တွင် ထည့်သွင်းရမည့် code ၏ မှန်ကန်သောပေါင်းစပ်မှုသည် အောက်ပါတို့အနက် အဘယ်နည်း? ဤနေရာတွင် လပတ်လစာအခြေခံသည် 100 ၏ မြှောက်ဖော်ကိန်းဖြစ်သည်။
[Program]
O integer: calculateTotalSal(integer: monthlyBaseSal)
integer: monthlyTotalSal
monthlyTotalSal <- integer part of (monthlyBaseSal x 1.05)
if (monthlyTotalSal > [A])
monthlyTotalSal <- integer part of (monthlyTotalSal x [B])
endif
return monthlyTotalSal
Correct answer: b — A: 5000, B: 0.8
English
The threshold is 5000. A 20% tax deduction means keeping 80%, so multiply by 0.8. Thus A=5000, B=0.8.
မြန်မာ
နှစ်ဆင့်မျဉ်းသည် 5000 ဖြစ်သည်။ 20% အခွန်နုတ်ပယ်ခြင်းဆိုသည်မှာ 80% ကျန်ရှိသောကြောင့် 0.8 ဖြင့်မြှောက်ရသည်။ ထို့ကြောင့် A=5000, B=0.8 ဖြစ်သည်။
More questions on the same topic
တူညီသောခေါင်းစဉ်မှ မေးခွန်းများ