Data Types
1. The algorithm shown in Figure 1 is designed to help an athlete with their training. It uses two subroutines getBPM and wait:
getBPM() returns the athlete’s heart rate in beats per minute from an external input device
wait(n) pauses the execution of the algorithm for n seconds, so wait(60) would pause the algorithm for 60 seconds.
Line numbers have been included but are not part of the algorithm
Figure 1
1 seconds ← 0 2 rest ← 50 3 REPEAT 4 bpm ← getBPM() 5 effort ← bpm – rest 6 IF effort ≤ 30 THEN 7 OUTPUT 'faster' 8 ELSE 9 IF effort ≤ 50 THEN 10 OUTPUT 'steady' 11 ELSE 12 OUTPUT 'slower' 13 ENDIF 14 ENDIF 15 wait(60) 16 seconds ← seconds + 60 17 UNTIL seconds > 200State the most appropriate data type of the variable seconds in the algorithm shown in Figure 1.
Ai এর মাধ্যমে
১০ লক্ষ+ প্রশ্ন ডাটাবেজ
প্র্যাকটিস এর মাধ্যমে নিজেকে তৈরি করে ফেলো
উত্তর দিবে তোমার বই থেকে ও তোমার মত করে।
সারা দেশের শিক্ষার্থীদের মধ্যে নিজের অবস্থান যাচাই
No related questions found